Lazo Lab Sign up

App 1: Your First App, a Quiz Game / Build the quiz

Lesson 3 of 10

Ask one question

Ask a question, store the answer, and compare it with the right one using ==. Use .lower() so 'Paris' and 'paris' both count.

Key points

  • Compare with ==
  • .lower() ignores capitals
  • if / else gives feedback
answer = input("What is the capital of Kuwait? ")
if answer.strip().lower() == "kuwait city":
    print("Correct!")
else:
    print("Not quite, it's Kuwait City.")

Your turn

Add your own first question under step 2 and test it with a right and a wrong answer.

Watch a video on thisOpens YouTube search results for “Ask one question” in a new tab

Quiz · +10 XP

Why use .lower() when checking answers?

Log in to save progress and earn XP.