Skip to content

Instantly share code, notes, and snippets.

@hsaito
Created March 25, 2018 00:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hsaito/2fc1ff816d367adb8af3d744616634fc to your computer and use it in GitHub Desktop.
Save hsaito/2fc1ff816d367adb8af3d744616634fc to your computer and use it in GitHub Desktop.
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