[Tutor] [Fwd: Re: From Newbie]
Marilyn Davis
marilyn at deliberate.com
Sun Jun 22 21:28:29 CEST 2008
On Sun, June 22, 2008 7:55 am, paul at assured-networks.co.uk wrote:
> hi Danny,
>
>
> As far as i am aware you must declare your variable first, something like
> a=0
That's a good thought. But he did initialize his variable.
The '!' and the '=' in '!=' are all smashed together without spaces.
So:
> while a ! = 0:
Should be:
while a != 0:
That should get you going again.
Marilyn Davis
>
> The same would go for s
>
>
> hope that helps
>
> paul
>
> On Sun Jun 22 10:45 , Danny Laya sent:
>
>
>
>
>
> Hi ! I have learned wiki tutor for non-programmer and I found some hill
> that stopping me. In Non-Programmer's Tutorial for Python/Count to 10,
> wiki ask me to write this code : a = 1 s = 0 print 'Enter Numbers to add to
> the sum.' print 'Enter 0 to quit.' while a != 0: print 'Current Sum:', s
a =
> int(raw_input('Number? ')) s = s + a print 'Total Sum =', s
>
> But when i write while a != 0: and then i press enter,
> python terminal tell me :
>>>> while a ! = 0:
> File "", line 1
> while a ! = 0: ^
> SyntaxError: invalid syntax
>
>
> Can you
find my mistake, guys ? Sorry to bother you, I try to
> find the answer in google, but I can't found the answer. Please help me
> soon guys, whatever your answer. If you don't want to answer my question,
> please give me some site that could answer this newbie question. Thank's.
>
>
>
>
>
>
>
>
>
>
> _______________________________________________
> Tutor maillist - Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
More information about the Tutor
mailing list