Created
May 19, 2018 21:38
-
-
Save accessnash/754df22de8087c9cb98f3d69d78b6cc3 to your computer and use it in GitHub Desktop.
sum of multiples of 3 and 5 below 1000
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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