day1/exercise/collatz.py
author Puneeth Chaganti <punchagan@fossee.in>
Tue, 12 Jan 2010 19:03:34 +0530
changeset 354 5dc6c3673f9d
parent 64 333092b68926
child 386 a0bec380b44f
permissions -rw-r--r--
Changes made during REC Chennai workshop.

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