Write a python program to find a maximum of given three numbers (use ternary operator)

 

a = int(input("Enter First number :"))
b = int(input("Enter Second number :"))
c = int(input("Enter third number :"))
 
if a>b and a>c:
    max_num = a
elif b>a and b>c:
    max_num = b
elif c>a and c>b:
    max_num = c
else:
    max_num = "all are equal"

print("Max Number : ",max_num)                

"""
Output :
Enter First number :12
Enter Second number :5
Enter third number :0
Max Number :  12


"""

Comments