Collatz

python3 --version

Python code:

nogeens = "j"

while nogeens == "j":

    print (" ")

    num=int(input("Geef een geheel getal groter dan nul: "))

    grootste = num

    stoppingtime=0

    print (num)

    while num>1:

        stoppingtime += 1

        if (num % 2) == 0: num = num/2

        else: num = 3*num+1

        if num > grootste: grootste = num

        print (int(num))

    print ("De STOPPING TIME is", stoppingtime)

    print ("Het grootste getal was", int(grootste))

    print (" ")

    nogeens=input("Nog eens (j/n)?")