From 629eb86ce0d30dd6031fa482f4a477ac3df345ab Mon Sep 17 00:00:00 2001 From: Tianyi Zheng Date: Sun, 30 Jul 2023 22:23:23 -0700 Subject: [PATCH] Fix merge conflicts to merge change from #5080 (#8911) * Input for user choose his Collatz sequence Now the user can tell the algorithm what number he wants to run on the Collatz Sequence. * updating DIRECTORY.md --------- Co-authored-by: Hugo Folloni Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> --- DIRECTORY.md | 1 + maths/collatz_sequence.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/DIRECTORY.md b/DIRECTORY.md index af150b129..aa9bd313b 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) diff --git a/maths/collatz_sequence.py b/maths/collatz_sequence.py index 4f3aa5582..b47017146 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.")