Gandalf <[EMAIL PROTECTED]> wrote: > how can I do width python a normal for loop width tree conditions like > for example : > > for x=1;x<=100;x+x: > print x >
What you wrote would appear to be an infinite loop so I'll assume you meant to assign something to x each time round the loop as well. The simple Python translation of what I think you meant would be: x = 1 while x <= 100: print x x += x If you really insist on doing it with a for loop: def doubling(start, limit): x = start while x <= limit: yield x x += x ... for x in doubling(1, 100): print x -- http://mail.python.org/mailman/listinfo/python-list