Moved 1 to 5 to Python and learned a ton.

This commit is contained in:
2019-07-13 23:58:38 -04:00
parent 414cf4b074
commit b246d56acd
13 changed files with 402 additions and 2 deletions

11
python/e001.py Normal file
View File

@@ -0,0 +1,11 @@
def get_sum_of_natural_dividable_by_3_and_5_below(m):
return sum([x for x in range(m) if x % 3 == 0 or x % 5 == 0])
def euler_001():
return get_sum_of_natural_dividable_by_3_and_5_below(1000)
assert(get_sum_of_natural_dividable_by_3_and_5_below(10) == 23)
assert(euler_001() == 233168)
print("e001.py: {}".format(euler_001()))