Input and Output
Taking user input and displaying results.
Input and Output is a free Python For Kids lesson on CoddyKit — lesson 3 of 3. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Python For Kids learning path, one of 3 lessons in the course, and your progress syncs across the web and the CoddyKit app.
1
Input and Output
Welcome to the next step in your Python journey! Today, we'll learn how to take input from users and display results. This will make your programs interactive and dynamic.

2
What is Input and Output?
- Input: Any data you enter into your program.
- Output: The data your program sends out, like messages or results.
By using input and output, your programs can interact with users and respond to their actions.
3
Taking User Input
To get input from a user, you can use the input() function. This allows the program to ask questions and receive answers.
# Asks the user for their name and stores it in the variable 'name'
name = input("What is your name? ")4
Displaying Output
To show information to the user, use the print() function. This will display messages or results on the screen.
Example:
# Greets the user by their name
print("Hello, " + name + "!")5
Combining Input and Output
You can combine input() and print() to create interactive programs. Let's create a simple greeting program.
Example:
# Takes the user's name
name = input("What is your name? ")
# Greets the user with their name
print("Hello, " + name + "!")
6
Taking Numerical Input
By default, input() returns data as a string. To work with numbers, you need to convert the input to the appropriate data type.
Example:
# Takes the user's age as a string
age = input("How old are you? ")
# Converts the age to an integer
age = int(age)
# Displays the age
print("You are " + str(age) + " years old.")
7
Using Float for Decimals
If you need to handle decimal numbers, convert the input to a float.
Example:
# Takes the user's height
height = input("What is your height in meters? ")
# Converts the height to a float
height = float(height)
# Displays the height
print("Your height is " + str(height) + " meters.")8
Example Program: Simple Age Calculator
Let's create a program that asks for the user's name and age, then tells them how old they will be next year.
Code:
# Takes the user's name
name = input("What is your name? ")
# Takes the user's age as a string
age = input("How old are you? ")
# Converts the age to an integer
age = int(age)
# Calculates the next age
next_age = age + 1
# Displays the result
print("Hello, " + name + "! Next year, you will be " + str(next_age) + " years old.")
9
11
Great Job!
You've learned how to take input from users and display results in Python. This makes your programs interactive and fun! Keep practicing by creating your own input and output programs.

Frequently asked questions
Is the “Input and Output” lesson free?
Yes — the full text of “Input and Output” is free to read here on the web, and the Python For Kids course includes 3 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Python For Kids course, upgrade to CoddyKit PRO.
What will I learn in “Input and Output”?
Taking user input and displaying results. You practise Python For Kids with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Python For Kids?
No prior experience is required. Python For Kids on CoddyKit is structured for beginners through advanced learners; this is — lesson 3 of 3, so you can start here or from the beginning and move at your own pace.
How long does the “Input and Output” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Python For Kids lesson?
Yes. Every Python For Kids lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Variables and Data Types
- Basic Arithmetic Operations
- Input and Output