1
Hatchling0 / 300 XP
0day streak 0stars
Your Python practice
Mock tests Readiness
More
Guest mode · saved on this device.

Hello, Python

A program is a list of instructions the computer follows from top to bottom, one line at a time.

The first instruction everyone learns is print(). Whatever you put between the parentheses shows up in the output.

print("Hello!")
print("Each print starts a new line")

Text goes inside quotes. Python calls a piece of text a string. Single and double quotes both work: 'Hello' and "Hello". Use the other kind around text containing a quote: 'Ask for "Mia"' or "Don't forget ID".

Press Run (or Ctrl+Enter), then press Step through your code and use Next: the highlighted line is the one about to run, and Output gains one line per print.

See it run

print("Good morning")
print("Good", "morning")
print("It's", 3, "o'clock")

Each print draws one line in the Output. Watch what happens to the quote marks.

Practice hello, python

Exercise 1

Print exactly two lines:

  • Hello, Python!
  • I am learning to code.

Exercise 2

A café needs a door sign. Print Open at 8 and Closed on Sunday on separate lines.

Exercise 3

Print a three-line parcel notice: Parcel ready, Ask for "Mia", then Don't forget ID. Keep the quote marks shown around Mia.

Free lesson: use the editor to practice it.

Practice

Loading Python…
More
Loading exercise content…
Visualizer Watch your code run line by line

Run your code, then choose Play to follow its execution.

Memory · names → values
Variables appear here as Python creates them.
Output & plots

One-line daily quest