Language vs runtime
Python is both:
- A language — rules for writing instructions (syntax).
- A runtime — a program that reads those instructions and carries them out.
You write source code (plain text). The runtime turns it into actions: printing text, calculating values, talking to files, and so on.
print("hello")What does the Python runtime do with your `.py` file?
Indentation is structure
Many languages use braces { } to group statements. Python uses indentation (leading spaces) to show which lines belong together — for example, the body of an if or a loop.
Mixing tabs and spaces, or guessing the indent, causes IndentationError. Pick 4 spaces per level and stay consistent.
for i in range(3):
print(i)
print("done")In Python, indentation is only cosmetic and never changes program meaning.
How many times does `print(1)` run in: `for i in range(3): print(1)` ?
Example: 3 · integer