def collatz number if number number return elif number number return p

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
def collatz(number):
if number % 2 == 0:
x = (number // 2)
return x
elif number % 2 == 1:
y = (3 * number + 1)
return y
print('Wanna see some magic?\nType any positive integer number and I will transform it into 1!')
UserNumber = int(input())
result = collatz(UserNumber)
print(result)
while result != 1:
NewResult = collatz(result)
result = NewResult
print(NewResult)
if result == 1:
print('It is Magic,\n bitch :)')