Skip to content

Instantly share code, notes, and snippets.

@accessnash
Created May 19, 2018 21:38
Show Gist options
  • Select an option

  • Save accessnash/754df22de8087c9cb98f3d69d78b6cc3 to your computer and use it in GitHub Desktop.

Select an option

Save accessnash/754df22de8087c9cb98f3d69d78b6cc3 to your computer and use it in GitHub Desktop.
sum of multiples of 3 and 5 below 1000
mlist = []
for x in range(1, 1000):
if x %3 ==0 and x % 5 ==0:
mlist.append(x)
elif x % 3 ==0:
mlist.append(x)
elif x % 5==0:
mlist.append(x)
print(sum(mlist))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment