0

functions and arguments

I have defined function as follows: def max(x, y): if x >y: return x elif y>x: return y else: print ("equal") called function as follows: print(max(4, 4)) result expected is : equal but result came as: equal none please explain why none came in output

19th Dec 2016, 11:29 AM
k harsha vardhan
k harsha vardhan - avatar
1 Resposta
0
i think because you didn't write return statement in else .
19th Dec 2016, 11:55 AM
Ahmed Gamal
Ahmed Gamal - avatar