// 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
// 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…
// 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…
// Exercise
caesar_cipher.py
Caesar Cipher — enumerate() + modulo to shift and wrap the alphabet. Loop through every letter, encrypt like Caesar.
// Exercise
form_wannabe.py
Form Wannabe — for loop drives an interactive sequence. One field at a time, one question at a time. No list, no databa…
// Exercise
password_strength_checker.py
Password Strength Checker — for + if visits every character, flags track what's found. Four checks, one verdict.
// Exercise
pig_latin.py
Pig Latin Translator — for + if + continue. Loop through every word, skip what's too short, translate the rest.
// Exercise
accumulator.py
Accumulator — while True + break. Keep adding numbers until you say stop. Total and count — both ready at the end.
// Exercise
rock_paper_scissors.py
Rock, Paper, Scissors — while counts the rounds, random plays for the computer, continue handles invalid input. A full …
// Exercise
vending_machine.py
Vending Machine — match identifies the product, if handles the payment. Change calculated, unknown products caught by c…
// 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 …