From edf2cd2b0c81898aa2c2c735eff39924b2e4aa9e Mon Sep 17 00:00:00 2001 From: Edward Nuno Date: Mon, 5 Oct 2020 19:42:16 -0700 Subject: [PATCH] Fix typehints in project_euler/problem01 (#2891) Squashed commit of the following: commit 6801d073b31bf702814861cd3b07b634ca295bfa Author: Archaengel Date: Mon Oct 5 16:40:10 2020 -0700 Fix typehints in project_euler/problem01 commit 29afc3af114abd1b99dc3f7c8fc99128229db131 Author: Archaengel Date: Mon Oct 5 15:06:34 2020 -0700 Add typehints and default argument for project_euler/problem_01 --- project_euler/problem_01/sol1.py | 2 +- project_euler/problem_01/sol2.py | 2 +- project_euler/problem_01/sol3.py | 2 +- project_euler/problem_01/sol4.py | 2 +- project_euler/problem_01/sol5.py | 2 +- project_euler/problem_01/sol6.py | 2 +- project_euler/problem_01/sol7.py | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/project_euler/problem_01/sol1.py b/project_euler/problem_01/sol1.py index e81156eda..2dbb60cdb 100644 --- a/project_euler/problem_01/sol1.py +++ b/project_euler/problem_01/sol1.py @@ -6,7 +6,7 @@ Find the sum of all the multiples of 3 or 5 below N. """ -def solution(n): +def solution(n: int = 1000) -> int: """Returns the sum of all the multiples of 3 or 5 below n. >>> solution(3) diff --git a/project_euler/problem_01/sol2.py b/project_euler/problem_01/sol2.py index 8041c7ffa..212fd4056 100644 --- a/project_euler/problem_01/sol2.py +++ b/project_euler/problem_01/sol2.py @@ -6,7 +6,7 @@ Find the sum of all the multiples of 3 or 5 below N. """ -def solution(n): +def solution(n: int = 1000) -> int: """Returns the sum of all the multiples of 3 or 5 below n. >>> solution(3) diff --git a/project_euler/problem_01/sol3.py b/project_euler/problem_01/sol3.py index c0bcbc06e..faa505615 100644 --- a/project_euler/problem_01/sol3.py +++ b/project_euler/problem_01/sol3.py @@ -6,7 +6,7 @@ Find the sum of all the multiples of 3 or 5 below N. """ -def solution(n): +def solution(n: int = 1000) -> int: """ This solution is based on the pattern that the successive numbers in the series follow: 0+3,+2,+1,+3,+1,+2,+3. diff --git a/project_euler/problem_01/sol4.py b/project_euler/problem_01/sol4.py index e01dc977d..d5e86320d 100644 --- a/project_euler/problem_01/sol4.py +++ b/project_euler/problem_01/sol4.py @@ -6,7 +6,7 @@ Find the sum of all the multiples of 3 or 5 below N. """ -def solution(n): +def solution(n: int = 1000) -> int: """Returns the sum of all the multiples of 3 or 5 below n. >>> solution(3) diff --git a/project_euler/problem_01/sol5.py b/project_euler/problem_01/sol5.py index bd96d965f..eae62ef5c 100644 --- a/project_euler/problem_01/sol5.py +++ b/project_euler/problem_01/sol5.py @@ -8,7 +8,7 @@ Find the sum of all the multiples of 3 or 5 below N. """A straightforward pythonic solution using list comprehension""" -def solution(n): +def solution(n: int = 1000) -> int: """Returns the sum of all the multiples of 3 or 5 below n. >>> solution(3) diff --git a/project_euler/problem_01/sol6.py b/project_euler/problem_01/sol6.py index c9f94b9f7..ca08a4a63 100644 --- a/project_euler/problem_01/sol6.py +++ b/project_euler/problem_01/sol6.py @@ -6,7 +6,7 @@ Find the sum of all the multiples of 3 or 5 below N. """ -def solution(n): +def solution(n: int = 1000) -> int: """Returns the sum of all the multiples of 3 or 5 below n. >>> solution(3) diff --git a/project_euler/problem_01/sol7.py b/project_euler/problem_01/sol7.py index a0510b54c..8e53d2a81 100644 --- a/project_euler/problem_01/sol7.py +++ b/project_euler/problem_01/sol7.py @@ -6,7 +6,7 @@ Find the sum of all the multiples of 3 or 5 below N. """ -def solution(n): +def solution(n: int = 1000) -> int: """Returns the sum of all the multiples of 3 or 5 below n. >>> solution(3)