Lazo Lab Sign up

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

Lesson 2 of 10

Welcome the player

Start with input() to ask the player's name and print a welcome. Run it. Seeing something work early keeps you motivated.

Key points

  • input() waits for typing
  • f-strings put the name in the message
  • .strip() removes extra spaces
name = input("What's your name? ").strip()
print(f"Welcome to the quiz, {name}! Let's go.")

Your turn

Add the welcome code under step 1 and run python3 quiz.py.

Watch a video on thisOpens YouTube search results for “Welcome the player” in a new tab

Quiz · +10 XP

What does .strip() do to " Sara "?

Log in to save progress and earn XP.