4.01
Completed
User Input with input() User Input with input()

Learn how to make Python programs interactive by asking the user for text with input().

User Input with input()

Sounds useful?

Jump into the interactive version.

No setup. No account. Just Python.

Interactive Python lesson

User Input with input()

This Block shows you how to make a Python program talk to the person running it. You will start with the smallest useful interactive program: ask a question, wait for the answer, save it in a variable, and use it later in printed output.

The focus is beginner-friendly and practical. You will see how input() works, why storing the answer matters, how the program continues from top to bottom, and how to ask more than one question without turning your code into spaghetti with feelings.

What you will learn:

  • Use input() to collect text from the user
  • Store the returned answer in a variable
  • Use the saved answer inside print() and f-strings
  • Understand the difference between the text shown to the user and the value saved by Python
  • Ask multiple questions in order
  • Avoid common beginner mistakes like forgetting parentheses or not saving the answer

By the end, your programs will no longer be tiny lonely scripts. They will be able to ask, wait, remember, and respond. Still simple, but much more alive.

> Start now 73 cards · about 7 min

Ready to practice this in the browser?

> Play now