Problem with += (augmented assignment)
mjjacob at my-deja.com
mjjacob at my-deja.com
Wed Dec 13 11:42:55 EST 2000
Of course I tried:
x = 0
while x <= 42:
x += 1
I screwed up the TAB when posting
In article <9188og$q57$1 at nnrp1.deja.com>,
mjjacob at my-deja.com wrote:
> Hi folks!
>
> I tried this under Python 2.0 running on Win 2k:
>
> x = 0
> while x <= 42:
> x += 1
>
> Python always complains a Syntax Error: Invalid
> Syntax on this:
>
> x += 1
> ^
> SyntaxError: invalid syntax
>
> Augmented assignment only seems to work when used
> in first indentation level (script level).
> Otherwise, I always get that syntax error, it
> does not matter whether I am using if, while or
> whatever.
>
> Is there something terribly wrong with the +=
> operator or is that all my fault?
>
> Help appreciated.
>
> Sent via Deja.com
> http://www.deja.com/
>
Sent via Deja.com
http://www.deja.com/
More information about the Python-list
mailing list