Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # made by JumpYScriptsz
- # SUMMARY - If num = odd, (num x 3)+1, if even num / 2
- import time
- # VARIABLES #
- sleep = 0.01
- # OTHER VARIABLES DONT TOUCH #
- x = True
- count = -1
- # ======== main part here, DONT touch ======== #
- num = int(input("Enter a number: "))
- while x == True:
- count = count + 1
- time.sleep(sleep)
- if (num % 2) == 0:
- num = num/2
- print(int(num))
- elif num == 1:
- print()
- print("ended with",count,"numbers formed!")
- x = False # change this 2 true for inf loop
- else:
- num = (3*num)+1
- print(int(num))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement