[Tutor] (no subject)
Roelof Wobben
rwobben at hotmail.com
Sun Sep 5 16:17:06 CEST 2010
> From: steve at pearwood.info
> To: tutor at python.org
> Date: Sun, 5 Sep 2010 23:55:32 +1000
> Subject: Re: [Tutor] (no subject)
>
> On Sun, 5 Sep 2010 11:44:09 pm Roelof Wobben wrote:
> > Hello,
> >
> > I have made this program as solution to a exercise from thinking like
> > a computer scientist.
> [...]
> > But now Im getting this error message :
> >
> > Traceback (most recent call last):
> > File "C:\Users\wobben\workspace\oefeningen\src\test.py", line 33, in
> > <module> test = make_empty([1, 2, 3, 4])
> > File "C:\Users\wobben\workspace\oefeningen\src\test.py", line 21, in
> > make_empty if type(element) == type([]):
> > NameError: global name 'element' is not defined
> >
> >
> >
> > What went wrong here ?
>
> Read the error message again:
>
> NameError: global name 'element' is not defined
>
> You are trying to use something called "element", but you haven't
> created anything with that name. The error message even tells you were
> the problem is: line 21, in the function "make_empty".
>
>
>
> --
> Steven D'Aprano
> _______________________________________________
> Tutor maillist - Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
Hello Steven.
I understand the error message.
I follow this example in the book : http://openbookproject.net/thinkcs/python/english2e/ch11.html
And there element is not defined.
Roelof
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20100905/6741ef53/attachment.html>
More information about the Tutor
mailing list