Created
February 9, 2018 11:37
-
-
Save pyplacca/7f87be3e9a935830f6c11fb0f2a203ce to your computer and use it in GitHub Desktop.
Depending on the range passed in the function, the sum of all multiples of 3 or 5 below the range will be returned
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
def multiples3or5(numRange): | |
mults3or5 = [] | |
for naturals in range(0,numRange): | |
if naturals in range(3,numRange,3) or naturals in range(5,numRange,5): | |
mults3or5.append(naturals) | |
return sum(mults3or5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment