0
Here is an function to return the maximum value among three positive integers.
Here is an function to return the maximum value among three positive integers. There is an error in this function. Provide an input triple (n1,n2,n3), where n1, n2 and n3 are all positive integers, for which max3bad produces an incorrect output. def max3bad(x,y,z): maximum = 0 if x >= y: if x >= z: maximum = x elif y >= z: maximum = y else: maximum = z return(maximum)
4 Antworten
+ 3
Lothar I think he already did work out something. It is complicated though 😅
+ 2
srinithi subramanian , please show us your code as it was used to run. In your description, we cannot see indentation. Best way would be to put it in playground and then link it here. Thanks!
+ 2
What is the issue here?
You could also just...
def max3bad(a,b,c):
return max(a,b,c)
+ 2
Tomiwa Joseph , nice code from you. But we still do not know the real issue that srinithi subramanian had with his code.
I try to get people to work out something on their own.