🐍 Python Tutorial
# imports

# variables
world = '🌍🌎🌏'
python = 'Python 🐍'
fire = '🔥'

# Function definitions

# Put code to run under here
print(f'Hello {world}')

Project 1 — Step 3 of 16

⭐ Step 3 — Print variables

➡️ Print the contents of a variable.

With an f-string (that’s the little f before the '), you can drop a variable into your sentence by putting its name in curly brackets {}.

✏️ What to type

Change the print line so it uses {world}:

print(f'Hello {world}')
# imports

# variables
world = '🌍🌎🌏'
python = 'Python 🐍'
fire = '🔥'

# Function definitions

# Put code to run under here
print(f'Hello')

Tap ▶ Run. You should see:

Hello 🌍🌎🌏

🔍 Tip

The little f in front of the quote lets you print variables right inside a sentence.

💡 If you get a red error

Check you opened and closed all your brackets () and curly brackets {}.

Next → Step 4

⬅ Back to Step 2


Adapted from Raspberry Pi Foundation — Hello World under CC BY-SA 4.0.