GCGrowCarrer

Input and Output

Locked

Lesson 4 of 60 · Syntax · Easy

StringsNext: Conditionals

Finish these first:Variables and Types →Or pass the tests below to unlock it now.

1

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.
Key words (tap to learn):
2

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!

3

Quick check

Which line displays the value of a variable named `city` in Python?

4

Your challenge

2 sample tests, 1 hidden

Create a variable named message set to "Hello, Ada" and print it with print(message).

Stuck? Get a hint (free)
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.

Mastery0%

Learn this first

Opens up next

This is the last lesson in this branch.