Making a decision
An if statement runs a block of code only when its condition is true. The condition ends with a colon, and the block underneath is indented — Python uses that indentation to know what belongs to the if.
temperature = 31
if temperature > 28:
print("Hot")
else:
print("Mild")
else catches every other case. Four spaces is the convention for one indent level, and it must be consistent.
What can be a condition?
Anything that produces True or False: the comparison operators ==, !=, >, <, >=, <=, plus the words and, or and not.
The classic first error
Forgetting the colon or the indent gets you a SyntaxError or IndentationError pointing at the line. Both are easy to fix once you know to look for them.