On Mon, Apr 25, 2011 at 1:13 PM, Prasad, Ramit <ramit.pra...@jpmchase.com>wrote:

> b = + 2 is legal syntax, while b + = 2 is not.
>
> Why do you 'b += 2' is not legal syntax? It seems to work in python 2.x and
> 3.x. Is this deprecated or looked down upon? Is it better to use 'b = b + 2'
> ?
>
> For the +2, it did not even occur to me that it was referring to a positive
> number and not some kind of addition/concatenation. Whoops!


b +space= 2, where there is a space between + and =

+= is perfectly legal, and (I would argue) the better choice.

-Wayne
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to