Title: Building a Sudden-Death Quiz CLI Game in Python (And What I Learned About Dictionary Lookups)

Today, as part of my daily 20–30 minute coding streak, I built a terminal-based Sudden-Death Quiz Game in Python. One wrong answer, and the loop breaks immediately.

🛠️ How It Works Under the Hood

  • Data Structure: I stored 5 questions (covering tech, gaming, and cinema) and their answers in two separate dictionaries mapped by keys 1 to 5.
  • UX Timing: Instead of delaying before showing the question, I placed print(quiz[i]) above time.sleep(2) so the player reads the prompt while the timer builds tension.
  • Clean Matching: Applied .lower().strip() on both ends so capitalization doesn't ruin a right answer.

🐛 Bugs I Caught Along the Way

  1. Dictionary Slicing: I initially tried slicing the dictionary (quiz[1:1:5]) before realizing dictionaries require direct key indexing (quiz[i]).
  2. Loop Scope: My first draft placed input() outside the for loop, meaning it only asked one question instead of iterating through all five.

⚖️ Honest Progress Check (75/25 Split)

  • 75% Me: Creating the questions, writing every line in VS Code, designing the sudden-death break rule, and fixing the timer UX.
  • 25% AI Mentorship: Getting hints on why dictionary slicing threw an error and spotting indentation placement—no copy-pasting solutions.

What is one small CLI project you built when learning Python dictionaries? Drop your thoughts below! 👇

here is the link to the code please watch it and review it thank you ❤️
https://github.com/MANAN-FULLSTACK-DEV/PYTHON-BASICS-PRACTICE-AND-LEARNING/blob/main/quiz%20game.py__