From f503ae4ebe888d9b06770d63216f56c54818bf79 Mon Sep 17 00:00:00 2001 From: Hugo Folloni Date: Wed, 6 Oct 2021 13:44:39 -0300 Subject: [PATCH 1/2] Input for user choose his Collatz sequence Now the user can tell the algorithm what number he wants to run on the Collatz Sequence. --- maths/collatz_sequence.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maths/collatz_sequence.py b/maths/collatz_sequence.py index 4f3aa5582731..b47017146a1e 100644 --- a/maths/collatz_sequence.py +++ b/maths/collatz_sequence.py @@ -57,7 +57,7 @@ def collatz_sequence(n: int) -> Generator[int, None, None]: def main(): - n = 43 + n = int(input("Your number: ")) sequence = tuple(collatz_sequence(n)) print(sequence) print(f"Collatz sequence from {n} took {len(sequence)} steps.") From 338119ded5f9908dc2785aaa65e4e9873b4ca858 Mon Sep 17 00:00:00 2001 From: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Date: Mon, 31 Jul 2023 01:50:01 +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 af150b12984b..aa9bd313b898 100644 --- a/DIRECTORY.md +++ b/DIRECTORY.md @@ -740,6 +740,7 @@ * [Tower Of Hanoi](other/tower_of_hanoi.py) ## Physics + * [Altitude Pressure](physics/altitude_pressure.py) * [Archimedes Principle](physics/archimedes_principle.py) * [Basic Orbital Capture](physics/basic_orbital_capture.py) * [Casimir Effect](physics/casimir_effect.py)