Permalink
Switch branches/tags
Nothing to show
Find file Copy path
ec93b13 Dec 27, 2016
1 contributor

Users who have contributed to this file

18 lines (13 sloc) 441 Bytes
#
# Solution to Project Euler problem 1
# Copyright (c) Project Nayuki. All rights reserved.
#
# https://www.nayuki.io/page/project-euler-solutions
# https://github.com/nayuki/Project-Euler-solutions
#
# Computers are fast, so we can implement this solution directly without any clever math.
def compute():
ans = sum(x for x in range(1000) if (x % 3 == 0 or x % 5 == 0))
return str(ans)
if __name__ == "__main__":
print(compute())