Conditional Statements
if/elif/else conditions, indentation as part of the syntax, and/or/not connectives.
The if statement runs code only when the condition is true. Python's peculiarity: the body of the condition is set off by indentation (4 spaces) — here indentation is part of the syntax, not decoration.
Comparisons: == (equal), != (not equal), < > <= >=. Equality is two signs ==; a single = means assignment.
Python
Enter a number — the program will say whether it is even
Multiple branches are written with elif ("else if"). Conditions are combined with the words and, or and not — Python reads almost like English.
A handy feature: chained inequalities work directly, you can write 7 <= age <= 17.
Python
Enter three numbers, for example: 3 9 5
Task: read an age and print "school" if it is between 7 and 17 inclusive, otherwise "other". Try both ways of writing the condition: with the and connective and with a chained inequality.
Then solve the attached problem "Even or Odd" and mark the lesson as completed.