Conditional statements
# if CONDITION(S): # FIRST STATEMENT # ... # LAST STATEMENT x = 8 if x%2 == 0: print x, "is even" #if-else construction if x%2 == 0: print x, "is even" else: print x, "is odd" #if-elif-else x = 240 y = 120 if (x < y): print x, "is smaller than", y elif (x > y): print x, "is larger than", y else: print x, "is equal to", y