From 21977f7854cdcf7310906843728b86195b83ebd6 Mon Sep 17 00:00:00 2001 From: Joyce Date: Thu, 9 Sep 2021 17:01:34 +0800 Subject: [PATCH 1/2] [mypy] fix type annotations for problem003/sol1 and problem003/sol3 --- project_euler/problem_003/sol1.py | 4 ++-- project_euler/problem_003/sol3.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/project_euler/problem_003/sol1.py b/project_euler/problem_003/sol1.py index 3441dbf9e0b3..1f329984203a 100644 --- a/project_euler/problem_003/sol1.py +++ b/project_euler/problem_003/sol1.py @@ -92,8 +92,8 @@ def solution(n: int = 600851475143) -> int: return n for i in range(3, int(math.sqrt(n)) + 1, 2): if n % i == 0: - if isprime(n / i): - max_number = n / i + if isprime(n // i): + max_number = n // i break elif isprime(i): max_number = i diff --git a/project_euler/problem_003/sol3.py b/project_euler/problem_003/sol3.py index bc6f1d2f61ca..e13a0eb74ec1 100644 --- a/project_euler/problem_003/sol3.py +++ b/project_euler/problem_003/sol3.py @@ -57,7 +57,7 @@ def solution(n: int = 600851475143) -> int: i += 1 ans = i while n % i == 0: - n = n / i + n = n // i i += 1 return int(ans) From 699d5796947ca748591295b641016bc33a4e623c Mon Sep 17 00:00:00 2001 From: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Date: Thu, 9 Sep 2021 09:03:14 +0000 Subject: [PATCH 2/2] updating DIRECTORY.md --- DIRECTORY.md | 1 + 1 file changed, 1 insertion(+) diff --git a/DIRECTORY.md b/DIRECTORY.md index 0c00d5ca7f70..eba63e17eaff 100644 --- a/DIRECTORY.md +++ b/DIRECTORY.md @@ -449,6 +449,7 @@ * [Find Min Recursion](https://github.com/TheAlgorithms/Python/blob/master/maths/find_min_recursion.py) * [Floor](https://github.com/TheAlgorithms/Python/blob/master/maths/floor.py) * [Gamma](https://github.com/TheAlgorithms/Python/blob/master/maths/gamma.py) + * [Gamma Recursive](https://github.com/TheAlgorithms/Python/blob/master/maths/gamma_recursive.py) * [Gaussian](https://github.com/TheAlgorithms/Python/blob/master/maths/gaussian.py) * [Greatest Common Divisor](https://github.com/TheAlgorithms/Python/blob/master/maths/greatest_common_divisor.py) * [Greedy Coin Change](https://github.com/TheAlgorithms/Python/blob/master/maths/greedy_coin_change.py)