Week 2
Python Foundations II
Conditions, loops, functions, and collections.
Learning goals
- if, elif, else
- for and while loops
- functions and return values
- lists, tuples, sets, dictionaries
- basic file reading and writing
Suggested classroom flow
| Session | Focus | Output |
|---|---|---|
| Day 1 | Concept introduction and guided examples | Notebook or script |
| Day 2 | Hands-on lab and teacher walkthrough | Working code |
| Day 3 | Practice tasks and discussion | Assignment draft |
| Day 4 | Assessment and mini project | Submission |
Mini project
Student Report Generator
Outcome for the week: students should finish with usable code, a short explanation, and at least one visual or result artifact.
Quick MCQ preview
Q1. Which keyword defines a function?
Explanation: Python uses def.
Q2. Which collection stores key-value pairs?
Explanation: dict stores key-value pairs.
Q3. Which loop is best when the number of repetitions is known?
Explanation: for is used when iteration count is known.