n++ < 10 syntax error??

rihad rihad at mail.ru
Sun Jan 13 11:28:10 EST 2002


Hi there, continuing with my foray into the innards of Python, I found
myself stumbled over this:

n = 0
while n++ < 10:
  pass

Gives a syntax error. Changing n++ to ++n compiles fine.... What the
hell is going on???

(P.S. I know I can use the "for n in range(10)" idiom, but what's
wrong with n++?)

TIA




More information about the Python-list mailing list