// 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
if_statement.py
if statement — comparison operators, True/False conditions, real use cases. Your code runs only when it should.
// Code Example
else_statement.py
if / else — the fallback that guarantees one block always runs. Every decision, both sides covered.
// Code Example
elif_statement.py
elif — chain multiple conditions, first match wins. Order matters, most specific goes first.
// Exercise
pace_communications.py
PACE decision system — if / elif / else in action. Four conditions, four protocols, zero silence.
// Exercise
ticket_pricing.py
Ticket pricing system — if / elif / else for categories, and for the window seat surcharge. Two decisions, one final pr…
// Other
if_mistakes.py
6 mistakes almost every beginner makes with if. Wrong way, error, right way — all in one file.
// Cheatsheet
if / elif / else — The Full Picture
if / elif / else — The Full Picture. Everything you've learned about conditions — in one place. Comparison operators, l…
// Achievement
if_complete_medal.stl
You finished the IF chapter. Download, print, and keep it. You earned it.
// Code Example
ternary_operator.py
Ternary operator — if / else compressed to one line. Syntax, examples, common mistakes, and when to use the full form i…
// Exercise
ticket_pricing_2.py
Ticket pricing rewritten with ternary — where it works, where it doesn't, and why the window seat line is the ideal use…
// Code Example
for_loops.py
for loops — iterating over strings, updating variables with +=, and understanding len(). Write it once, the loop handle…
// Code Example
range_function.py
range() — stop, start/stop, step, counting backwards, and combining with len(). Tell Python the boundaries, it handles …
// Code Example
loop_counter.py
Loop counter — +=, -=, *= inside a loop. Define before, update inside, use after. Track everything that happens iterati…
// Code Example
enumerate_function.py
enumerate() — position and value on every iteration. No counter, no manual increment. Unpack and use.
// Code Example
zip_function.py
zip() — two sequences, one loop. Items matched by position, stops at the shortest. No counter needed.