CurriculumPython input() and Type Conversion for Kidsinput() asks, and really waits

Python input() Function Explained for Beginners

The one command that genuinely talks to the player — everything before this never did.

Lesson 1 of 5PROAges 10+
See what PRO unlocks →

input() asks, and really waits

Everything you've written so far runs the instant you press Run. input() is different — it actually stops and waits.

input() shows a question, waits for an answer, and hands that answer back to you as a value you can store.

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

Nothing before this point ever waited for YOU. print(), if, for — none of them pause. input() is the one exception.

Whatever the player types comes back as TEXT — even if they type a number. That matters, and we'll come back to it.

Check your understanding

You write print("Hello") with no input() anywhere. Does the program wait for you to type anything?

print("Hello")
  • No — it just runs straight through and finishes
  • Yes, it always pauses in case you want to type something

Why: It runs straight through with no pause. Only input() makes a program wait for something you type.

name = input("Name? "). What TYPE of value does name hold, even if the player types "7"?

name = input("Age? ")
  • Text (a string) — always, no matter what was typed
  • A number, if the player typed digits

Why: input() always returns text — a string — no matter what the player types. "7" looks like a number to us, but Python treats it as three characters until you convert it.

What you'll practice

input() asks a question and waits for the answer. Use input("What is your name? ") to ask, store the answer in a box called name, then print it back.

Unlock this lesson with PRO →

More from this topic

input() asks, and really waits is one lesson inside Python input() and Type Conversion for Kids — see the full lesson order and what the whole topic covers.

View the full topic →