Python program to find greater, smaller or equal of three numbers using logical operator

Python program to find greater, smaller or equal of three numbers using logical 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:

    print(f"{a} is greater than {b} and {c}")

elif b>c and b>a:

    print(f"{b} is greater than {a} and {c}")

elif c>a and c>b:

    print(f"{c} is greater than {a} and {b}")

else:

    print(f"Three numbers {a},{b},{c} are equal")


Output:

Enter first number 15

Enter second number 12

Enter third number 13

15 is greater than 12 and 13

टिप्पणी पोस्ट करा

0 टिप्पण्या