Skip to content

Instantly share code, notes, and snippets.

@ebartrum
Created November 30, 2014 21:57
Show Gist options
  • Save ebartrum/1b3ba20f316999bb4281 to your computer and use it in GitHub Desktop.
Save ebartrum/1b3ba20f316999bb4281 to your computer and use it in GitHub Desktop.
A solution to the 1st Euler Challenge
#Find the sum of all the multiples of 3 or 5 below 1000.
"""I will define function mult() which returns true
if it's argument is divisible by 3 or 5."""
def mult(x):
if x%3==0:
return True
elif x%5==0:
return True
else:
return False
sum=0
for i in range(1000):
if mult(i):
sum+=i
print(sum)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment