0

how to find maximum value

A = input("\n input A ") B = input("\n input B ") C = input("\n input C ")

29th Aug 2016, 9:16 AM
Aitor Teeratouch
Aitor Teeratouch - avatar
3 Answers
+ 1
max=A if B>A: max=B if C>max: max =C #max is the answer
29th Aug 2016, 10:05 AM
Nimsara
0
if a>=b and a>=c: print(a) elif b>=a and b >=c: print(b) else : print(c)
29th Aug 2016, 10:07 AM
Yaroslav Syncha
Yaroslav Syncha - avatar
0
you can also try python built-in function max() max(a, b, c) you can pass multiple variables as an argument, or even a whole list, set or tuple
29th Aug 2016, 7:57 PM
Demeth
Demeth - avatar