Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import time
- number = int(input("Enter number: "))
- while number > 1:
- if number % 2 == 0: # if even, divide by 2
- number /= 2
- else: # if odd, multiply by three and add one.
- number = number * 3 + 1
- print(int(number))
- time.sleep(1000000)
Add Comment
Please, Sign In to add comment