Skip to content

Commit 9ab8052

Browse files
committed
adding doctests
1 parent 320f8f2 commit 9ab8052

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

project_euler/problem_095/sol1.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Problem 95
33
Url: https://projecteuler.net/problem=95
44
"""
5-
def find_smallest_member(n: int) -> int:
5+
def solution(n: int = 10**6) -> int:
66
"""
77
Returns the smallest member of the longest amicable chain with no element exceeding one million
88
>> 14316
@@ -35,4 +35,7 @@ def find_smallest_member(n: int) -> int:
3535

3636

3737
if __name__ == "__main__":
38-
print(f"Solution : {find_smallest_member(10**6)}")
38+
import doctest
39+
40+
doctest.testmod()
41+
print(f"{solution() = }")

0 commit comments

Comments
 (0)