Xiaobai would like to ask you, why does this code each print twice?

the following is the code

def collatz(number):
    if number%2==0:
        number=number//2
        print(str(number))
        return number
    else:
        number=number*3+1
        print(str(number))
        return number
print("enter your number")
number=int(input())
while number!=1:
    collatz(number)
    number=collatz(number)

this is the result
enter your number
5
16
16
8
8
4
4
2
2
1

Mar.21,2021

change it to:

  

function called

twice
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3c337-2c2e9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3c337-2c2e9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?