# Sums the values from 0 to 10,000 inclusively # only sum multiples of 3 total = 0 for i in range(10001): # only add to sum if the number is a multiple of 3 if i % 3 == 0: total += i # "total += i" is shorthand for "total = total + i" print("Sum of all numbers from [0,10000], multiples of 3:", total)