[Tutor] From Newbie

broek at cc.umanitoba.ca broek at cc.umanitoba.ca
Sun Jun 22 16:03:06 CEST 2008



> But when i write while a != 0: and then i press enter,
> python terminal tell me :
>>>> while a ! = 0:
>   File "<stdin>", line 1
>     while a ! = 0:
>             ^
> SyntaxError: invalid syntax
>
> Can you find my mistake, guys ? Sorry to bother you, I try to


Hi,

Python's trying to give you a hint:

>     while a ! = 0:
>             ^
> SyntaxError: invalid syntax

So, there's something it doesn't like around the `!' character.  
Compare the error message to what you say you wrote:

> while a != 0:

Notice any differences?

Best,

Brian vdB


More information about the Tutor mailing list