Skip to main content

Python If Else

 if else: It checks the if condition if condition is true then if statements are executed otherwise else statements are executed.

Syntax:

            if(condition):

                        #statements

            else:

                        #statements

Program:

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

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

if(a>b):

    print(a," is big")

else:

    print(b," is big")

Output:

Enter a value

23

Enter b value

656

656  is big

Comments