(number)
Collatz the number and print each step and tracks the number of them.
Collatz the number and print each step and tracks the number of them.
Collatz the number and print each step and tracks the number of them .
def collatz(number):
    """Collatz the number and print each step and tracks the number of them."""
    if number > 1:
        steps = 0
        while number != 1:
            if number % 2 == 0:
                print(int(number / 2))
                number = number / 2
                steps += 1
            else:
                print(int(number * 3 + 1))
                number = number * 3 + 1
                steps += 1
        print('Collatz sequence finished in ' + str(steps) + ' steps')
    else:
        print("You entered 1. You clearly can't read"
              "so I'm shutting down before I catch your idiocy.")
def collatz ( number ) : if number > 1 : steps = 0 while number != 1 : if number % 2 == 0 : print ( int ( number / 2 ) ) number = number / 2 steps += 1 else : print ( int ( number * 3 + 1 ) ) number = number * 3 + 1 steps += 1 print ( 'Collatz sequence finished in ' + str ( steps ) + ' steps' ) else : print ( "You entered 1. You clearly can't read" "so I'm shutting down before I catch your idiocy." )