[Tutor] increment operator

hugonz@h-lab.net hugonz at h-lab.net
Sat May 28 20:54:54 CEST 2005


No, there is not. Integers are inmutable types, so you cannot modify them
in place, so you do:

i += 1

or

i = i+1

which creates a new integer and makes "i" reference it.

Hugo

> Hello
> 	 Is there a increment operator in python similar to c++
> like so 	"SomeVariable++"
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>




More information about the Tutor mailing list