From e70c27d434d22413a5a43d4830f30592d7564dd2 Mon Sep 17 00:00:00 2001 From: Archaengel Date: Mon, 5 Oct 2020 18:51:26 -0700 Subject: [PATCH] Fix typehints in project_euler/problem01 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 e81156edaee4..2dbb60cdb16f 100644 --- a/project_euler/problem_01/sol1.py +++ b/project_euler/problem_01/sol1.py @@ -6,7 +6,7 @@ """ -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 8041c7ffa589..212fd40562d1 100644 --- a/project_euler/problem_01/sol2.py +++ b/project_euler/problem_01/sol2.py @@ -6,7 +6,7 @@ """ -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 c0bcbc06ec83..faa505615924 100644 --- a/project_euler/problem_01/sol3.py +++ b/project_euler/problem_01/sol3.py @@ -6,7 +6,7 @@ """ -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 e01dc977d8cf..d5e86320da5e 100644 --- a/project_euler/problem_01/sol4.py +++ b/project_euler/problem_01/sol4.py @@ -6,7 +6,7 @@ """ -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 bd96d965f92d..eae62ef5c75c 100644 --- a/project_euler/problem_01/sol5.py +++ b/project_euler/problem_01/sol5.py @@ -8,7 +8,7 @@ """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 c9f94b9f77c8..ca08a4a639ab 100644 --- a/project_euler/problem_01/sol6.py +++ b/project_euler/problem_01/sol6.py @@ -6,7 +6,7 @@ """ -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 a0510b54c409..8e53d2a81fb9 100644 --- a/project_euler/problem_01/sol7.py +++ b/project_euler/problem_01/sol7.py @@ -6,7 +6,7 @@ """ -def solution(n): +def solution(n: int = 1000) -> int: """Returns the sum of all the multiples of 3 or 5 below n. >>> solution(3)