← Lesson
BitWithBite
Python · Quick Reference

Phase 2 Projects Cheat Sheet

Python
In one line: Conditionals, loops, lists, dicts, sets, and functions — all working together. Build 4 programs that feel genuinely useful.

Key Ideas

Code Examples

# ══════════════════════════════════════════════ # Number Guessing Game — Phase 2 Project 1 # ══════════════════════════════════════════════ import random LEVELS = { "easy" : {"range": (1, 50), "attempts": 10}, "medium": {"range": (1, 100), "at...
# ══════════════════════════════════════════════ # Expense Tracker — Phase 2 Project 2 # ══════════════════════════════════════════════ expenses = [] def add_expense(amount, category, desc): """Add an expense record to the list.""" expenses.appen...
# ══════════════════════════════════════════════ # Caesar Cipher — Phase 2 Project 3 # ══════════════════════════════════════════════ def shift_char(ch, shift): """Shift a single letter by shift positions (preserves case).""" if ch.isalpha(): ...