If–Else Statements
x = 10 if x > 5: print("x is greater than 5")
else
if condition: # runs if condition is True else: # runs if condition is False
age = int(input("Enter your age: ")) if age >= 18: print("You are an adult") else: print("You are not an adult")
if
if True: print("Inside IF") else: print("Inside ELSE") print("Outside both")
What will this print?
x = 3 if x > 10: print("Big number") else: print("Small number")
Ask the user for a number: