Created
July 2, 2013 18:32
-
-
Save 0xBADDCAFE/5911833 to your computer and use it in GitHub Desktop.
in computer_science room(#Lingr).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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