Skip to content

Instantly share code, notes, and snippets.

@pyplacca
Created February 9, 2018 11:37
Show Gist options
  • Save pyplacca/7f87be3e9a935830f6c11fb0f2a203ce to your computer and use it in GitHub Desktop.
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
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