The Console Game Pack

Beginner · 90 min build · 🏆 milestone project

You are past single-purpose scripts now. This project asks you to build a small console game pack, a text program with a menu, a number game, and two useful calculators, using only the Part I tools you already have.

Your goal is comfort, not cleverness: read input, convert types, choose branches, and repeat work with loops. Keep the code plain. No functions, no files, no random numbers, and no packages yet.

What you'll build

You will build one console workspace with four routes:

  • 1: a fixed-secret number guessing game.
  • 2: a tip calculator.
  • 3: a grade calculator.
  • 7: an exit route. (Why 7 and not 4? To prove the menu matches exact text, not positions — choice == "7" compares strings.)

The scaffold is starter code with comments that show where each part belongs. The acceptance criteria are checks that tell you a stage works without needing a reviewer.

python — playgroundlive
⌘/Ctrl + Enter to run

Checkpoint 1: the menu routes

Start with the menu. It is the front desk for the whole pack: the user chooses one route, and Python sends them to the right branch.

Acceptance criteria:

  • Entering 7 prints Goodbye and stops.
  • Entering 1, 2, or 3 reaches that project section.
  • Entering another value prints a clear fallback message.
  • The menu uses if/elif/else, not a loop that can run forever.

Checkpoint 2: the number guessing game

The number game practices input, int(), comparisons, for, range(), break, and a small Boolean flag. A flag is a Boolean variable that remembers whether something has happened.

Keep the secret fixed for now. Random numbers come later; a fixed value makes the game easier to test.

Acceptance criteria:

  • The player gets a limited number of guesses.
  • A low guess prints Too low; a high guess prints Too high.
  • A correct guess prints how many attempts it took.
  • Running out of attempts prints the secret number.
  • Changing secret_number at the top changes the answer everywhere.

Checkpoint 3: the tip and grade calculators

The calculators are not games, but they use the same Part I muscles. You turn input text into numbers, process those numbers, and print useful output.

Acceptance criteria:

  • The tip calculator accepts a bill amount, tip percent, and number of people.
  • It prints the tip amount, total bill, and per-person amount with two decimal places.
  • It handles 0 people with a friendly message instead of dividing by zero.
  • The grade calculator converts a numeric score into A, B, C, D, or Needs practice.
  • The grade calculator uses attendance to add a second note.

Checkpoint 4: test the whole pack

Do not trust a program because one path worked. Walk every path like a careful user.

Acceptance criteria:

  • Choice 1 works for a win and for running out of guesses.
  • Choice 2 works for a normal bill and for 0 people.
  • Choice 3 works for a high score, a passing score, and a low score.
  • Choice 7 exits cleanly.
  • No route uses files, imports, functions, random numbers, or collections in depth.

Stretch goals

Choose one or two after the base pack works:

  • Add an attendance bonus to the grade calculator.
  • Let the number game give a warmer message on the final guess.
  • Add a 4 route that checks whether a password attempt matches a fixed password.
  • Use match/case for the top-level menu after the if version works.

How to get unstuck

If input comes in as text, revisit lesson 2.4 and check every int() or float() conversion. If a branch goes the wrong way, trace the condition with lesson 4.1. If a loop will not stop, compare it to the bounded patterns in lesson 4.3. If your output looks messy, f-strings and .2f from lesson 3.3 are the cleanup tools.

You have finished Part I when this pack feels understandable, not magical. Next, collections give you a way to hold many values under one name, which opens up bigger programs without making the code louder.

+50 XP on completion