Define a function max() that takes two numbers as arguments and returns the largest of them. Use the if-then-else construct available in Python. (It is true that Python has the max() function built in, but writing it yourself is nevertheless a good exercise.)
def max(a,b):
if a > b:
print (a)
elif a < b:
print (b)
elif (a==b):
return (a)
print ("function executed")
print (max(4,5))
max(1,2)
The output of this function is,
2
function executed
None
5
function executed
None