The problem sounds like this: "If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
Find the sum of all the multiples of 3 or 5 below 1000."
I have written some code below and I'm confused as to why it doesn't work
s1 = 0
s2 = 0
for i in range(0,1000,3):
s1 = s1 + i
for i in range(0,1000,5):
s2 = s2 + i
suma = s1 + s2
print(suma)
On top of this, I tried assigning the value of 0 to all the variables at once:
suma, s1, s2 = 0
#the rest of the code here
And I'm getting the following error: TypeError: cannot unpack non-iterable int object
How do I assign everything at once? Do I even need to assign every variable to 0 in order for my code to work or is it similar to Turbo Pascal where every int variable automatically gets assigned 0?