You speak — your program listens. It replies — you read. That’s the whole game!
What is Input / Output? 📤
A two-way conversation between you and your program!
Like Talking to a Friend — You Speak, They Answer!
Every program I ever built needed to talk to the person using it. Ask their name. Show a result. Input is what you give the program. Output is what the program gives back. It is a conversation — just like talking to a friend!
You Give Info IN!
Typing, clicking, pressing — any info you send to the program!
Program Shows BACK!
Text, numbers, results — anything the program shows to you!
Think of a microphone and speaker. You talk INTO the microphone (input). The speaker plays sound OUT (output). Programs work exactly the same way!
Input / Output in Real Life 🌍
Every device around you uses input and output every single second!
6 Real Life Input / Output Examples!
Every device you use every day follows the same input → process → output pattern. Once you see it, you will spot it absolutely everywhere!
Keyboard
Video Game
ATM
Alexa
Microwave
Every single device you can think of follows input → process → output. Once you see the pattern — you cannot unsee it! Your whole world runs on this idea!
print() — Show Output on the Screen! 🖨️
Your program’s voice — it shows anything you want!
print() — Your Program Speaking to You!
The very first line of Python code every kid ever writes is print(“Hello, World!”). And guess what — you were already using output from day one! print() shows anything you want on the screen!
Print Text
print("Hello, World!")→ Hello, World!
Print Numbers
print(100)print(3.14)→ 100 and 3.14
Print Variables
print(name)print("Score:", score)→ Shows the value!
# print() shows anything on screen! print("Hello, World!") # → Hello, World! print(100) # → 100 print("Score:", 500) # → Score: 500 name = "Sara" print("Hello,", name) # → Hello, Sara
print() is the most used function in all of Python. Every program you ever write will use it. It is your program’s way of talking to the person using it!
input() — Ask the User a Question! ❓
Your program’s ears — it listens and waits for the answer!
input() — Ask a Question and Wait for the Answer!
The input() function makes your program ask a question and then PAUSE — waiting for the person to type something. Whatever they type gets stored in a variable. Your program just listened!
# Ask and store the answer! name = input("What is your name? ") # Program pauses here — waits for typing! # User types: Sara # name = "Sara" ✅ city = input("What city are you from? ") # User types: London # city = "London" ✅
Big rule — ALWAYS store input() in a variable! If you forget the variable, the answer is gone forever. name = input(“Name?”) — the name before = is essential!
Use Them Together — Ask Then Answer! 🔄
input() + print() = a real interactive program!
Step 1 — Ask With input(). Step 2 — Show With print()!
When you combine input() and print(), your program suddenly feels alive! It asks questions, listens to answers, and responds — just like a real conversation!
User types something
Program stores + uses it
Program shows result!
# Full interactive greeter program! name = input("What is your name? ") # → User types: Sara print("Hello,", name + "! 👋") # → Hello, Sara! 👋 print("Nice to meet you,", name + "! 🎉") # → Nice to meet you, Sara! 🎉
This 3-line program was the moment everything clicked for me. My code was talking to me! It asked my name and greeted me personally. That is the magic of input and output working together!
⚠️ input() Always Gives TEXT — Even Numbers! 🔤
The biggest beginner trap — convert before you do maths!
Type in 5 — Get Back “5” — They Are NOT the Same!
This tripped me up every single day when I started. input() always returns text — even when the user types a number! You cannot do maths on text. You must convert it first!
input() gives text. You cannot add text to a number!
age = input("Age?")
result = age + 1
TypeError — cannot add str + int! 💥Use int() to convert text into a real number first!
age = int(input("Age?"))
result = age + 1
Works perfectly! 🎉# Convert input to a number! age = int(input("How old are you? ")) price = float(input("Enter price: ")) print("Next year you will be", age + 1) print("Price with tax:", price * 1.1)
int() converts text to a whole number. float() converts text to a decimal number. Wrap input() inside int() or float() whenever you plan to do maths!
4 Fun Mini-Programs You Can Build Right Now! 🏗️
Real programs — each one uses input and output!
4 Beginner Programs — Try Each One!
The best way to learn input/output is to build something real with them! Each of these programs takes less than 5 minutes to write — and they actually work!
Name Greeter
name = input("Name? ")
print("Hello,", name + "!")Age Checker
age = int(input("Age? "))
if age >= 10:
print("Old enough! ✅")Calculator
a = int(input("Num 1? "))
b = int(input("Num 2? "))
print("Sum:", a + b)Mini Story
name = input("Name? ")
city = input("City? ")
print(name,"lives in",city)I still remember the first time I built the name greeter. I showed my mum and she typed her name and it said “Hello, Mum!” She was so impressed. Build something for someone you love!
Input / Output in Scratch! 🐱
Say blocks for output — Ask and Wait for input!
Scratch Has Input and Output Blocks Too!
Scratch handles input and output with colorful drag-and-drop blocks. No typing needed — but the same input → output idea works exactly the same way!
say "Hello!" for 2 secsask "What is your name?"say (answer)In Scratch the Ask and Wait block is input. Say block is output. The Answer variable stores what the user typed — just like name = input() in Python!
Output Formatting — Make It Look Great! ✨
3 ways to make your output clean, clear and beautiful!
3 Smart Ways to Show Output!
Basic print() works fine — but these 3 tricks make your output look clean, professional, and easy to read!
"Hello, " + nameGlue text and variable together!
print("Score:", score)Separate with commas — auto spacing!
f"Hello, {name}!"Cleanest way — put variables inside { }!
name = "Sara" score = 500 # 3 ways to show output! print("Hello, " + name) # join print("Score:", score) # comma print(f"Hello, {name}! Score: {score}") # f-string ✨
f-strings are the cleanest and most modern way to format output. Once you start using them you will never go back. Just put the variable name inside curly braces { }!
Common Mistakes Kids Make 😅
I made every single one — so now you don’t have to!
4 Input / Output Mistakes Every Beginner Makes!
age = input("Age?")
age + 1input() gives text — cannot add text to a number!
age = int(input("Age?"))
age + 1int() converts text to number first!
print(Hello, World!)Text in print() must be inside quotes!
print("Hello, World!")Quotes around the text — always!
input("What is your name?")Asked but forgot to store the answer — gone forever!
name = input("What is your name?")Always assign input() to a variable!
Print("Hello!")
INPUT("Name?")Python is case sensitive — capital letters break it!
print("Hello!")
input("Name?")Always lowercase — print() and input()!
Mistake 1 — the type conversion trap — got me every single time for weeks. Now when I use input() for numbers, int() or float() is the first thing I reach for!
Quick Recap — Remember This! 🧠
4 things every kid should never forget about input and output!
4 Key Input / Output Rules!
Input = info you give TO the program — typing, clicking, pressing!
Output = info the program shows BACK to you — text, results, answers!
Use print() to show output — your program’s voice!
Use input() to get input — always returns text, convert before maths!
FAQs — Input / Output for Kids 🙋
4 most asked questions — clear answers below!
What is input and output in coding for kids?
Input is any information you give to the program — typing, clicking, pressing. Output is anything the program shows back to you — text, results, answers!
💬 Think of a conversation. You talk (input). Your friend answers (output). Programs work the same way — you give info in, the program gives results back!
Why does input() always return text in Python?
Because Python treats everything typed on a keyboard as text (a string) by default. You must tell Python to convert it to a number using int() or float() before doing maths!
🔢 age = int(input(“Age?”)) — the int() wraps around input() and converts the text to a whole number instantly. Always do this before adding or multiplying!
What is the difference between print() and input()?
print() shows information on the screen — it is output. input() asks the user a question and waits for their answer — it is input!
🖨️ print() = your program talking. 🎤 input() = your program listening. Use print() to speak, input() to listen!
How do you make a program that asks the user their name?
Just two lines! name = input(“What is your name? “) to ask and store the answer. Then print(“Hello,”, name) to show the greeting!
🎉 This is the perfect first program for any beginner. It uses both input and output — and it works! Try it right now!