mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 01:09:40 +08: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:
@ -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.")
|
||||
|
Reference in New Issue
Block a user