Input and Output
LockedLesson 4 of 60 · Syntax · Easy
Finish these first:Variables and Types →Or pass the tests below to unlock it now.
The big idea
To show a message on screen in Python, use print(...). You can pass text directly or print a variable you saved earlier: You can also combine text with + or an f-string like f"Hi, {name}" before printing it.
Think of it like this: Think of `print(...)` like a megaphone: whatever value you put inside the parentheses gets shown on screen.
Read the lesson
To show a message on screen in Python, use print(...). You can pass text directly or print a variable you saved earlier:
name = "Maya"
print("Welcome!")
print(name)
You can also combine text with + or an f-string like f"Hi, {name}" before printing it. After you press Run, check the Output tab to see everything your code printed!
Quick check
Which line displays the value of a variable named `city` in Python?
Your challenge
Create a variable named message set to "Hello, Ada" and print it with print(message).
More learning tools(compare languages, visual guide, related lessons)
Compare with another language
Similar to java.console-io (85% overlap). `input()/print()` vs `Scanner`/`System.out`.
Visual walkthrough
A diagram, a step-by-step animation, and short captions for Input and Output.
Learn this first
- Variables and TypesNot yet
Opens up next
This is the last lesson in this branch.