Created
March 25, 2018 00:32
-
-
Save hsaito/2fc1ff816d367adb8af3d744616634fc to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import unittest | |
def multiple3_5(high:int) -> int: | |
sum = 0 | |
for i in range (1, high): | |
if i % 3 == 0: | |
sum += i | |
elif i % 5 == 0: | |
sum += i | |
return sum | |
class TestProblem1(unittest.TestCase): | |
def test_example(self): | |
self.assertTrue(multiple3_5(10),23) | |
def test_answer(self): | |
print("Answer: "+str(multiple3_5(1000))) | |
if __name__ == '__main__': | |
unittest.main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment