Python Indentation
Multiple Choice Beginner
Question
How does Python define code blocks?
Hint
Python uses indentation, not braces.
Explanation
Python uses indentation to define code blocks, unlike most languages that use curly braces. Consistent indentation is required — mixing tabs and spaces causes errors. The standard is 4 spaces (PEP 8). Indentation must be consistent within a block but can differ between blocks.
Related Resources
Related Lessons
- Python Overview
Learn Python basics.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.