day1/exercise/collatz.py
author Puneeth Chaganti <punchagan@gmail.com>
Fri, 30 Apr 2010 12:40:11 +0530
changeset 391 92e56697e489
parent 386 a0bec380b44f
child 425 5afcfce15e71
permissions -rw-r--r--
Removed spaces in dashed lines of session2 day1.

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