// resources
Resources
All
|
Cheatsheet
Code Example
Exercise
Template
Other
Achievement
|
Basics
Control Flow
Functions
Data Structures
Modules & Packages
Projects
Object-oriented programming
|
↑ oldest first
↓ newest first
// Code Example
nested_for_loops.py
Nested for loops — a loop inside a loop. Inner completes fully before outer moves on. Total iterations = outer × inner.
// Code Example
for_if_nested.py
for + if in nested loops — filter at the outer level, inner level, or both. break stops the current loop only.
// Code Example
while_for_nested.py
while + for — while sets the pace, for does the work. break inside for stops only the for. Each loop has its job.
// Exercise
caesar_cipher_2.py
Caesar Cipher upgraded — nested loops encrypt a real word. Outer loop sets the target, inner loop finds and shifts it, …
// Exercise
password_strength_checker_2.py
Password Strength Checker upgraded — while True keeps asking, for checks every character. Flags reset on every attempt.…
// Exercise
hangman.py
Hangman — two players, one word. while keeps the game alive, two for loops handle display and guessing. continue skips …
// Other
nested_loops_mistakes.py
5 mistakes almost every beginner makes with nested loops. Indentation, break scope, counter placement, iteration count,…
// Cheatsheet
nested_loops_cheatsheet.pdf
Nested Loops & Patterns — The Full Picture. for+for, for+if, while+for, break scope, accumulators, common mistakes.