B4Coder
0%
LessonAbout 5 min

Chapter 1 · Lesson 2 of 5

02. One line after another

Programs run from top to bottom. Print several lines, and let Python do some maths for you.

Python follows your instructions in order, from the first line to the last. Each print shows its own line.

Python
print("Ready")print("Steady")print("Go!")

It shows

Ready
Steady
Go!
One instruction at a time, top to bottom.

Numbers don't need quotes. Without quotes, Python works the sum out first and prints the answer. With quotes, it's just text, so it prints exactly what's there.

Python
print(7 + 5)print("7 + 5")

It shows

12
7 + 5

Your turn

1Steps

  1. 1Print three lines: Python can count!, then the answer to 365 * 24 worked out by Python, then Done.

Starting code

The editor starts empty. Copy this into it to begin, or write your own from scratch.

Python
print("Python can count!")

2Expected output

It should show

Python can count!
8760
Done.

3Hints

Stuck? Open one hint at a time: each gives a bit more help.

Hint 1

You need three print lines, one under the other.

Hint 2

For the middle line, put the sum itself inside print, without quotes, so Python works it out.

Hint 3

The second line is print(365 * 24), and the third is print("Done.")

Terminal

Click Run to see what your program shows, then Submit answer to check it and unlock Next.