Home › Learn › Python › First steps

Hello, world

Lesson 1 of 40. Print text with print() and see how the lessons check your work.

Python runs your file from the top line to the bottom. print() writes whatever you put between the parentheses to the output. Text goes in quotes; you can use double quotes or single quotes as long as they match.

Each call to print() ends with a new line, so two calls give two lines. That is what the checks below look at: they read the lines you printed and compare them with what the task asks for, character for character, including punctuation.

print("Good morning")
print('Second line')

Your task

Print exactly two lines: the first says Hello, world! and the second says Python is running in my browser.

Hint 1

Each line is one print() call with the text in quotes.

Hint 2

Check the punctuation: a comma after Hello, an exclamation mark, a full stop at the end of the second line.

Show the solution
print("Hello, world!")
print("Python is running in my browser.")

    Runs CPython compiled to WebAssembly in this tab (12 MB download the first time, then cached); nothing is sent anywhere.