livepython.net

32. Fix a Python Program With Steps in the Wrong Order

EasyDebugging

Overview

This program runs without any error, but its output is wrong. Debug it like a detective.

Problem Statement

The starter code should print a morning routine in this order:

Wake up
Brush your teeth
Eat breakfast
Go to school

Run it, compare its output with the list above, and fix the order.

Input

No input is required for this question.

Output

Wake up
Brush your teeth
Eat breakfast
Go to school

Learn this firstChapter 3 · How to Debug Code: A Beginner's Guide to Fixing Errors
solution.py
print("Eat breakfast")
print("Wake up")
print("Go to school")
print("Brush your teeth")

EXPECTED OUTPUT

1Wake up
2Brush your teeth
3Eat breakfast
4Go to school

YOUR OUTPUT

Press Run to see your output here. Lines are compared with the expected output.