Skip to main content

Python elif

 

elif: If else needs if condition then that situation we can use the elif keyword.

Program:

a=int(input("Enter a value\n"))

b=int(input("Enter b value\n"))

c=int(input("Enter c value\n"))

if((a>b)and(a>c)):

    print(a," is big")

elif(b>c):

    print(b," is big")

else:

    print(c," is big")

Output:

Enter a value

23

Enter b value

56

Enter c value

6

56  is big

Comments