← Back to Python Course Foundations
Basics of Python¶
Learning Objectives¶
- Understand interpreter-based execution.
- Write correctly indented Python programs.
- Trace top-to-bottom flow with conditions.
Concept¶
Python executes statements sequentially and uses indentation to define code blocks.
Example¶
Dry Run¶
- Prints
Start num > 0is true -> printsPositive- Prints
End
Common Mistakes¶
- Mixed tabs/spaces.
- Missing indentation after
if,for,while,def.
Practice¶
- Write a script that prints even/odd for one input.
- Add nested condition with proper indentation.