#if statement # python support condtions like: # equal : a==b # not equal: a!=b # less than: a < b # greater than: a>b # less than or equal : a<=b # greater than or equal : a>=b # the form of if condition: #if conditions: # pass # code excuted if the condtion is achieved #example: '''a = 33 b = 200 if a > b : print("b is bigger than") # elif if condtion_1: #code_1 will excuted elif condtion_2: #code_2 will excuted''' #example: '''a = 33 b = 33 if b > a: print("b is bigger than a") elif a < b: print(" a is less than b") elif a == b: print("a is equal to be b")''' # else: is to excute code if any of the condtion is not true '''if condition: #code will excute elif condtion_2: #code else: #another code will excuted''' a = 200 b = 33 '''if b > a: print("b is greater than a") elif b == a: print("b is equal a") else: print("b is not greater than a")''' # and , or logical operators # and used to combine two conditional statements: '''if a < b and b == a: print("a is geater and equal b")''' '''if a > b or b == a: print("a is geater and equal b")''' #Nested If : if condition inside another if: '''x = 3 if x > 10: print("x is above 10") if x > 20: print(" x is greater than 20") else: print("x is not greater than 20") elif x < 10: print("x is less than 10") # The pass Statement if a > b: pass ''' a = 33 b = 200 if b > a: pass