[Tutor] loop problem

Tinman mikew@screaminet.com
Mon, 10 Jun 2002 18:42:10 -0500


I've been reading Alan's book on learning to program with Python. I'm 
currently working with the chapter on loops. I have an idea for a loop 
that I can't quite figure out. This is what I want to do.

1.Multiply 1 by 2
2.Take the result and multiply by 2
3.So on and so on thirty times
4.Print the final result

I tried this:

for i in range(1,31):
		b = i * 2
		print b

This prints 1 -30 times 2 as I'm sure you can tell. I can't figure out 
how to take each result an double it. Can anyone help a hapless Python 
newbie?