[Tutor] stuck newbie

paul meaney paul@meaney.cjb.net
Sun, 18 Aug 2002 23:27:08 +0100


*blushes*

thanks
----- Original Message -----
From: "Sean 'Shaleh' Perry" <shalehperry@attbi.com>
To: "paul meaney" <paul@meaney.cjb.net>
Cc: <tutor@python.org>
Sent: Sunday, August 18, 2002 6:17 PM
Subject: RE: [Tutor] stuck newbie


>
> On 18-Aug-2002 paul meaney wrote:
> >
> > Im a total newbie and this is my first effort at writing my own bit of
code.
> > The program asks for the user to enter details of soccer teams
performance
> > from their last six home/away games to calculate a performance score.
> >
> > Everything was going well to this point until I when it started skipping
the
> > section asking for home team and only inputs the team names and the
following
> > error message is generated;
> >
> > Traceback (most recent call last):
> >   File "E:\Documents and Settings\paul\Desktop\match_form.py", line 24,
in ?
> >     while aw + ad + al != 6 :
> > NameError: name 'aw' is not defined
> >
> > I know this will probably be a fundamental mistake, but your help and
> > guidance would be appreciated,
> >
>
> is this your entire script?  It looks like you simply forgot to initialize
the
> variables before the loop:
>
> aw = 0
> ad = 0
> al = 0
> while aw + ad + al != 6:
>     ...
>     ...
>
> in Python the variable must exist before it can be used.
>
>
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.381 / Virus Database: 214 - Release Date: 02/08/2002