'Can someone explain to me the part which is highlighted? [closed]

enter image description here

Im already done with the part before the highlighted part, but i can't understand the part which is highlighted and i dont want to look at the code.



Solution 1:[1]

Something like that:

number = int(input("Your number: "))
while number != 1 :
    number = collatz(number)

Solution 2:[2]

As I understand, it should be something along the lines:

def collatz(number):
    if number // 2 == 0:
        print(number // 2)
        return number // 2
    else:
        print(3 * number + 1)
        
def iterate_program:
    number = int(input())
    
    while number != 1:
        number = collatz(number)

And then you just call iterate_program.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2