Knowledge organisersSelection
Choose between two paths.
An if statement checks a condition — if True, the indented block runs. An optional else block runs when the condition is False. This lets the program choose between two paths.
if condition: runs block when Trueelse: runs when the condition is Falseage = int(input("Age: "))
if age >= 18:
print("Adult")
else:
print("Minor")