Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Main
- n = int(input("Enter n: "))
- print(n)
- try:
- while n != 1:
- if n%2 == 0:
- n = n/2
- print(n)
- else:
- n = 3*n + 1
- print(n)
- except ValueError:
- print("Value Error! You should have entered an unsigned integer number!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement