Python ++ Operator?

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


2011/7/15 Rafael Durán Castañeda <rafadurancastaneda at gmail.com>:
> 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.

ChrisA



More information about the Python-list mailing list