Skip to content

Commit 29afc3a

Browse files
committed
Add typehints and default argument for project_euler/problem_01
1 parent 7df91e6 commit 29afc3a

File tree

7 files changed

+7
-7
lines changed

7 files changed

+7
-7
lines changed

Diff for: project_euler/problem_01/sol1.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"""
77

88

9-
def solution(n):
9+
def solution(n: int = 1000) -> int:
1010
"""Returns the sum of all the multiples of 3 or 5 below n.
1111
1212
>>> solution(3)

Diff for: project_euler/problem_01/sol2.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"""
77

88

9-
def solution(n):
9+
def solution(n: int = 1000) -> 1000:
1010
"""Returns the sum of all the multiples of 3 or 5 below n.
1111
1212
>>> solution(3)

Diff for: project_euler/problem_01/sol3.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"""
77

88

9-
def solution(n):
9+
def solution(n: int = 1000) -> 1000:
1010
"""
1111
This solution is based on the pattern that the successive numbers in the
1212
series follow: 0+3,+2,+1,+3,+1,+2,+3.

Diff for: project_euler/problem_01/sol4.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"""
77

88

9-
def solution(n):
9+
def solution(n: int = 1000) -> int:
1010
"""Returns the sum of all the multiples of 3 or 5 below n.
1111
1212
>>> solution(3)

Diff for: project_euler/problem_01/sol5.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"""A straightforward pythonic solution using list comprehension"""
99

1010

11-
def solution(n):
11+
def solution(n: int = 1000) -> int:
1212
"""Returns the sum of all the multiples of 3 or 5 below n.
1313
1414
>>> solution(3)

Diff for: project_euler/problem_01/sol6.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"""
77

88

9-
def solution(n):
9+
def solution(n: int = 1000) -> int:
1010
"""Returns the sum of all the multiples of 3 or 5 below n.
1111
1212
>>> solution(3)

Diff for: project_euler/problem_01/sol7.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"""
77

88

9-
def solution(n):
9+
def solution(n: int = 1000) -> int:
1010
"""Returns the sum of all the multiples of 3 or 5 below n.
1111
1212
>>> solution(3)

0 commit comments

Comments
 (0)