๐Ÿ PyQuest๐Ÿ† Game: Quiz Show Champion ยท โ“ Step 1: Ask Your First Question
โญ 0 XP๐Ÿ Python is waking upโ€ฆ

Step 1: Ask Your First Question โ“

Welcome to your first big project! Over 4 steps you'll build a whole quiz show game. The best part: you never retype anything โ€” each step starts you off with what you built last time. ๐ŸŽฌ

Every quiz show starts with one question:

answer = input("What is the capital of France? ")

if answer == "Paris":
    print("โœ… Correct!")
else:
    print("โŒ Nope, it was Paris.")

But there's a problem. If your player types paris or PARIS or Paris, that if says WRONG. Rude! ๐Ÿ˜ค

Two string tricks fix it:

answer = input("Capital of France? ")
answer = answer.lower().strip()   # "  PaRiS  " โžœ "paris"

if answer == "paris":
    print("โœ… Correct!")
  • .lower() makes everything lowercase
  • .strip() chops off spaces at the ends

Now compare against the lowercase answer and everybody's happy.

Your mission

  1. Ask one quiz question with input()
  2. Clean the answer up with .lower()
  3. Use if / else to print a "correct!" or "wrong" reaction

Make it a question you would ask. ๐ŸŽค

Your code

Press โ–ถ Run to see what your code does!