Week 3 concept checklist
You should now be confident with:whileloop flow and update logic- factorial and digit-processing with loops
forloop withrange- direct iteration without
range - nested loops for patterns and tables
break,continue,pass- formatted printing using f-strings
High-value exam traps
- off-by-one in
rangeboundaries - wrong step sign in
rangecausing empty output - missing loop-variable update in
while continueskipping update and creating infinite loop- confusing
passwithcontinue - forgetting
0! = 1 - formatting mismatch: string with numeric format code
Integrated mixed practice
- Compute factorial using
while. - Compute sum of first
nnumbers usingfor. - Print 3x4 star grid using nested loop.
- Print odd numbers 1 to 15 using
continue. - Stop loop at first value divisible by 9 using
break. - Print table of
6with alignment:
Mixed MCQ drill
- Output?
- Output?
- Which keyword skips current iteration only?
- Which loop is better for iterating over string characters?
range(5, 1, -1)gives what values?
Answers
1 2 3 44continuefor5, 4, 3, 2
Next-step suggestion
Before Week 4:- solve 20 output-prediction questions on loops
- write 10 pattern programs from memory
- dry-run at least 5 nested-loop snippets by hand
