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.
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")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? ")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.
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 →