CurriculumPython input() and Type Conversion for Kidsint() turns text into a number
Why Python input() Always Returns Text, Not a Number
input() always gives you text — int() is how you turn digits into a real, usable number.
int() turns text into a number
input() always hands you text, even for a question like 'how old are you?'.
int(some_text) converts digit-text into a real number, one you can add, multiply, or compare.
age_text = input("Age? ")
age = int(age_text)
print(age + 1)You can also wrap the whole input() call directly: int(input("...")) does the same thing in one step.
age = int(input("Age? "))Without int(), Python treats the text like words — adding two of them GLUES them together instead of adding the numbers.
Check your understanding
gold_text = input("Gold? ") and the player types 5. What is gold_text + gold_text?
gold_text = input("Gold? ")
print(gold_text + gold_text)Why: "55". Without int(), gold_text is text, not a number — and adding two pieces of text joins them end to end.
What does int(input("...")) do, compared to plain input("...")?
Why: int() converts the text input() returns into a real number you can do math with. Without it, even '5' stays text.
What you'll practice
Ask "How much gold? " and wrap the answer in int(...) so it becomes a real number, not just digits-as-text. Then print that number plus 10.
More from this topic
int() turns text into a number 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 →