Skip to content

Instantly share code, notes, and snippets.

@0xBADDCAFE
Created July 2, 2013 18:32
Show Gist options
  • Save 0xBADDCAFE/5911833 to your computer and use it in GitHub Desktop.
Save 0xBADDCAFE/5911833 to your computer and use it in GitHub Desktop.
in computer_science room(#Lingr).
def prob001():
'''
Return answer of project euler problem 001 value.
Examples:
>>> prob001()
233168
'''
ans = 0
n=1000
for i in range(1, n):
if i % 3 == 0:
ans += i
elif i % 5 == 0:
ans += i
return ans
if __name__ == '__main__':
import doctest
doctest.testmod()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment