Python ++ Operator?

Chris Angelico rosuav at
Fri Jul 15 03:55:33 EDT 2011

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

++i is legal Python but fairly useless. It's the unary + operator,
applied twice. It doesn't increment the variable.

Now, i+=1 IS valid Python, and WILL do what a C programmer expects it to.


More information about the Python-list mailing list