7 ms·
Any particular reason you didn't go for the list comprehension? def pyChallenge(): print sum([el for el in range(1001) if not((el%5==0) or el%7==0))])
by mykhamill 15y ago
Any particular reason you didn't go for the list comprehension?
def pyChallenge():
print sum([el for el in range(1001) if not((el%5==0) or el%7==0))])
# this call is needed to test your function
pyChallenge()