🐍 Python Tutorial
# imports
from datetime import datetime

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

# Function definitions

# Put code to run under here
print(f'Hello {world}')
print(f'Welcome to {python}')
print(f'{python} is good at maths!')
print(f'{111111111 * 111111111}')
print(f'The date and time is {datetime.now()}')

Project 1 — Step 8 of 16

⭐ Step 8 — Print the date

➡️ Show the current date and time on the screen.

The datetime module has a function called now() that gives back the current date and time. We can use it inside an f-string.

✏️ What to type

Add another print line at the bottom:

print(f'The date and time is {datetime.now()}')
# imports
from datetime import datetime

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

# Function definitions

# Put code to run under here
print(f'Hello {world}')
print(f'Welcome to {python}')
print(f'{python} is good at maths!')
print(f'{111111111 * 111111111}')

Tap ▶ Run. You should see a new line at the end with the current date and time (yours will be different from this):

Hello 🌍🌎🌏
Welcome to Python 🐍
Python 🐍 is good at maths!
12345678987654321
The date and time is 2026-05-22 15:34:10.148000

💡 If you get a red error

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

Next → Step 9

⬅ Back to Step 7


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