How to continue programm after first iteration with input : After the end of the first round of my program (Collatz function) i want my program to continue to calculate from the previous result

I wrote a program with the possibility of one iteration, which starts from the input


def collatz(number):

    if number % 2 == 0: #parity conditions value
        return number // 2
    if number % 2 == 1: #parity oddness value
        return 3 * number + 1
result = 5

while True:

    print ('Type your number')
    result = int(input())
    print (collatz(result))


