Lesson 5: User Input

So far we only printed things (Output). Now let's learn how to ask things from the user (Input)!

The input() function

Pauses the program and waits for the user to type something and press Enter.

name = input("What is your name? ")

Your Objective

Ask the user for their favorite color.

  1. Create a variable color using input().
  2. Print a sentence using that variable.
main.py
Initializing Python Environment...