robin_johnson
Jul 30, 2026 • 20 views
Hey there! 👋 I'm Sarah, and I'm in 4th grade. My teacher keeps talking about 'print' and 'input' in Python, but I'm still a bit confused. Can someone explain it to me like I'm five? 😅
💻 Computer Science & Technology
1 Answers
✅ Best Answer
monica_contreras
Jan 3, 2026
📚 Understanding Print and Input in Python
Let's learn about two important words in Python: print and input. They help us talk to the computer and the computer talk back to us!
🖨️ What is 'Print'?
Imagine you want to tell the computer to show something on the screen. That's what print does! It's like shouting out a message for everyone to see.
- 📣 Showing Text:
print("Hello, world!")tells the computer to display 'Hello, world!' on the screen. - 🔢 Showing Numbers: You can also print numbers!
print(5 + 3)will show '8'. - ✨ Showing Results: It's how the computer shows you the answer to a question or the result of something it calculated.
⌨️ What is 'Input'?
Now, what if you want to ask the computer a question? That's where input comes in! It lets you type something into the computer.
- ❓ Asking Questions:
name = input("What is your name? ")asks you for your name. - 💾 Remembering Answers: The computer remembers your answer and stores it in something called a 'variable' (in this case,
name). - 🤝 Using the Answer: Then, the computer can use your answer later! For example,
print("Hello, " + name + "!")will greet you by name.
💡 Putting it Together
Think of it like this:
- You use
inputto give the computer information. - The computer does something with that information.
- The computer uses
printto show you the result.
➕ Example:
Here's a simple program that asks for your age and then tells you how old you'll be next year:
age = input("How old are you? ")age = int(age)(This turns your answer into a number)next_year = age + 1print("Next year, you will be " + str(next_year) + " years old!")
📝 Practice Quiz
Let's see if you got it! Answer these questions:
- What does
printdo? - What does
inputdo? - Write a line of code that asks the user for their favorite color and stores it in a variable called
color.
✅ Answers:
printshows text or numbers on the screen.inputlets the user type information into the computer.color = input("What is your favorite color? ")
Join the discussion
Please log in to post your answer.
Log InEarn 2 Points for answering. If your answer is selected as the best, you'll get +20 Points! 🚀