Python for Beginners

Execution Order

Description

In programming, code is generally executed line-by-line, from top to bottom, and this holds true for Python code as well. This means that the order in which you write your code is important.

For example, the following code:

print("First")
print("Second")
print("Third")

will output:

First
Second
Third

Challenge

In the code editor, there are three print statements. Rearrange them so that the output is:

Fourth
Fifth
Sixth

If you think you have the correct answer, click the Submit button.

Starter Code

print("Fifth")
print("Fourth")
print("Sixth")

Video Explanation

Click here to jump to the Execution Order section of the video.

Solution Code

print("Fourth")
print("Fifth")
print("Sixth")

On this page