A sum of multiples of 5 that misses 60

Code review · Basic · §7.7 [Pair coding with AI] Asking for loops

You asked an AI to add up all the multiples of 5 from 1 to 60, and it gave you this code. It prints 330 without errors, but that is wrong. Fix it so that it prints 390.

Code to fix

total = 0
for i in range(5, 60, 5):
    total += i
print(total)

Solve this problem in your browser

Python runs in your browser and checks your answer right away. Hints and the answer are on the problem page.