mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-11-27 15:01:08 +00:00
* 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 <hugofollogua07@gmail.com> Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
This commit is contained in:
parent
384c407a26
commit
629eb86ce0
|
@ -740,6 +740,7 @@
|
||||||
* [Tower Of Hanoi](other/tower_of_hanoi.py)
|
* [Tower Of Hanoi](other/tower_of_hanoi.py)
|
||||||
|
|
||||||
## Physics
|
## Physics
|
||||||
|
* [Altitude Pressure](physics/altitude_pressure.py)
|
||||||
* [Archimedes Principle](physics/archimedes_principle.py)
|
* [Archimedes Principle](physics/archimedes_principle.py)
|
||||||
* [Basic Orbital Capture](physics/basic_orbital_capture.py)
|
* [Basic Orbital Capture](physics/basic_orbital_capture.py)
|
||||||
* [Casimir Effect](physics/casimir_effect.py)
|
* [Casimir Effect](physics/casimir_effect.py)
|
||||||
|
|
|
@ -57,7 +57,7 @@ def collatz_sequence(n: int) -> Generator[int, None, None]:
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
n = 43
|
n = int(input("Your number: "))
|
||||||
sequence = tuple(collatz_sequence(n))
|
sequence = tuple(collatz_sequence(n))
|
||||||
print(sequence)
|
print(sequence)
|
||||||
print(f"Collatz sequence from {n} took {len(sequence)} steps.")
|
print(f"Collatz sequence from {n} took {len(sequence)} steps.")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user