All lessons

Find the Bug

Read the code and its wrong output, then spot the mistake

🐛 Wrong operator

This program has one bug. Compare what it prints with what it should print — then reveal where the bug is.

# add 2 to the total
total = 10
total = total - 2
print(total)

Actual output (wrong)

8

Expected output

12