Python

Lesson 1 of 10

Lesson ยท 5 min

Print a message

Your first program

A program is a list of instructions that a computer follows, one line at a time. In Python, the print function shows a message on the screen.

print("Good morning!")

The message in quotation marks is a string. A string is a piece of text. You can use double quotes "like this" or single quotes 'like this'.

Python does not need a semicolon at the end of a line. It uses the end of the line instead.

The first time you press Run, Python needs a few seconds to start in your browser. Later runs are fast.

Your turn

Write your code, then press Run. When you think you are done, press Check my work.

Tasks

2 to do

  1. Task 1, not checked yet. Print the text Hello, world! with print.

  2. Task 2, not checked yet. On the next line, print I am learning Python.

Task 1 of 2

Print the text Hello, world! with print.

All tasks

main.py

Ctrl+Enter runs your code. Ctrl+Shift+Enter checks it. Press Esc, then Tab, to leave the editor.

Output

Press Run to see your result

Your output shows here. Press Run to try your code.