yaymuffins
0
Q:

if condirion in python

a = 200
b = 33
if b > a:
	print("b is greater than a")

elif a == b:
	print("a and b are equal")

else:
	print("a is greater than b")

 
44
if (condition1):
  print('condition1 is True')
elif (condition2):
  print('condition2 is True')
else:
  print('None of the conditions are True')
8
# python program to illustrate nested If statement 
#!/usr/bin/python 
i = 10
if (i == 10): 
    #  First if statement 
    if (i < 15): 
        print ("i is smaller than 15") 
    # Nested - if statement 
    # Will only be executed if statement above 
    # it is true 
    if (i < 12): 
        print ("i is smaller than 12 too") 
    else: 
        print ("i is greater than 15") 
1

New to Communities?

Join the community