Python Syntax
Syntax is the rulebook. If you break it, Python refuses to run. Indentation defines blocks — usually 4 spaces. if, for, def, class lines end with a colon, then the body sits under them. No semicolon needed at the end of a normal line.
Python is case sensitive: Name and name are different. Mix tabs and spaces and you get IndentationError. # starts a comment. Freshers coming from Java keep adding braces; Python does not want them for blocks.
Exam line — indentation is not style. It is syntax. Say that, then show one if with a colon and two indented prints.
Python Syntax — output — Adult. The print sits inside if because it is indented.
if marks >= 40:
print("Pass") ← indent = block
else:
print("Fail")IndentationError — explain why it is syntax.