day1/exercise/collatz.py
author Nishanth Amuluru <nishanth@fossee.in>
Tue, 14 Dec 2010 23:15:36 +0530
branchscipyin2010
changeset 456 a27ccfc118fb
parent 425 5afcfce15e71
permissions -rw-r--r--
removed sslc1.txt from circulate since it is not required

num = int( raw_input( 'Enter number: ') )
while num != 4:
    print num,
    if num % 2 == 1:
        num = num * 3 + 1
    else:
        num /= 2
print 4, 2, 1