I am working my way through the Boring python book and have no previous experience with coding at all. I have just worked on a collatz system and I am curious as to how to loop the system indefinitely. Attached is the coding I have so far.
def collatz(number):
if number % 2 == 0:
result1 = number // 2
print(result1)
return result1
elif number % 2 == 1:
result2 = 3 * number + 1
print(result2)
return result2
n = input('Give me a number: ')
while n != 1:
n = collatz(int(n))
while n == 1:
~~~
I am curious as to what to put in the ~~~ to achieve this loop.