+= and =+

bartc bc at freeuk.com
Wed Sep 13 10:00:47 EDT 2017


On 13/09/2017 14:25, Andrej Viktorovich wrote:
> Hello,
> 
> I have done mistake while trying to increment int
> 
> i=1
> i=+
> 
> this left i unchangeable and I got no error. But what =+ means at all?

Did you mean i=+1 ?

This means i is set to the value +1. Usually just written 1.

Try:

   i=88
   i=+1

and see if i now changes.

-- 
bartc





More information about the Python-list mailing list