author | Nishanth Amuluru <nishanth@fossee.in> |
Tue, 14 Dec 2010 23:15:36 +0530 | |
branch | scipyin2010 |
changeset 456 | a27ccfc118fb |
parent 425 | 5afcfce15e71 |
permissions | -rw-r--r-- |
425
5afcfce15e71
REF: Reformat some of the exercises so they're easier to read for the audience.
Christopher Burns <chris.d.burns@gmail.com>
parents:
386
diff
changeset
|
1 |
num = int( raw_input( 'Enter number: ') ) |
5afcfce15e71
REF: Reformat some of the exercises so they're easier to read for the audience.
Christopher Burns <chris.d.burns@gmail.com>
parents:
386
diff
changeset
|
2 |
while num != 4: |
5afcfce15e71
REF: Reformat some of the exercises so they're easier to read for the audience.
Christopher Burns <chris.d.burns@gmail.com>
parents:
386
diff
changeset
|
3 |
print num, |
5afcfce15e71
REF: Reformat some of the exercises so they're easier to read for the audience.
Christopher Burns <chris.d.burns@gmail.com>
parents:
386
diff
changeset
|
4 |
if num % 2 == 1: |
5afcfce15e71
REF: Reformat some of the exercises so they're easier to read for the audience.
Christopher Burns <chris.d.burns@gmail.com>
parents:
386
diff
changeset
|
5 |
num = num * 3 + 1 |
64
333092b68926
Added quiz tex file and all exercise problems Madhu worked out.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
6 |
else: |
425
5afcfce15e71
REF: Reformat some of the exercises so they're easier to read for the audience.
Christopher Burns <chris.d.burns@gmail.com>
parents:
386
diff
changeset
|
7 |
num /= 2 |
386 | 8 |
print 4, 2, 1 |