Hey, I tryed the first problem of the Euler project, but for some reason the code bellow is not give me the correct answer:
def multiple_sum(multiple=3): x = 0 for n in range(0, 1000): if not (n % multiple): x += n return x print multiple_sum(5) + multiple_sum(3)
It is giving me 266333, where it should be giving me 266168
The problem discription is here:
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.
Edit: GOD DAMN THAT RANGE FUNCTION, SHOULD HAVE ADDED ONE TO INCLUDE 1000.
However, this doesn't fix my problem. I'm still hopelessly confused on that front.