Python ++ Operator?

Björn Lindqvist bjourne at
Fri Jul 15 03:46:52 EDT 2011

2011/7/15 Rafael Durán Castañeda <rafadurancastaneda at>:
> What's the meaning of using i++? Even, does exist ++ operator in python?

No it doesn't, which is a good thing. Python differentiates between
expressions and variable assignments. "i++" in C both assigns the
value i + 1 to i AND evaluates to i. Pre and post-increments are
almost always confusing unless they are used as the counter-variable
inside for-loops.

mvh/best regards Björn Lindqvist

More information about the Python-list mailing list