thank you
--
http://mail.python.org/mailman/listinfo/python-list
Gary Wessle wrote:
> Ryan Forsythe <[EMAIL PROTECTED]> writes:
>
>
>>Gary Wessle wrote:
>>
>>>the example was an in-accuretlly representation of a the problem I am
>>>having. my apologies.
>>>
(snip)
> I finally was able to duplicate the error with a through away code
> as follows,
>
>
Ryan Forsythe <[EMAIL PROTECTED]> writes:
> Gary Wessle wrote:
> > the example was an in-accuretlly representation of a the problem I am
> > having. my apologies.
> >
> > a = []
> > def prnt():
> >print len(a)
> >
> prnt
> >
> >
> > I expect to get 0 "the length of list a"
>
> You wa
> is the code below correct?
>
> b = 3
> def adding(a)
> print a + b
>
> it seams not to see the up-level scope where b is defined.
Yes except for the missing : at the end of the "def" line.
Rob
--
http://mail.python.org/mailman/listinfo/python-list
Gary Wessle wrote:
> the example was an in-accuretlly representation of a the problem I am
> having. my apologies.
>
> a = []
> def prnt():
>print len(a)
>
prnt
>
>
> I expect to get 0 "the length of list a"
You want prnt(), not prnt:
>>> a = []
>>> def prnt():
... print len(a)
...
Gary Wessle wrote:
> the example was an in-accuretlly representation of a the problem I am
> having. my apologies.
>
> a = []
> def prnt():
>print len(a)
>
prnt
>
>
> I expect to get 0 "the length of list a"
Python requires parenthesis to call a function.
>>> a = []
>>> def prnt(
Try >>> prnt()
o.o'
On 04 May 2006 08:25:01 +1000, Gary Wessle <[EMAIL PROTECTED]> wrote:
> "Steve R. Hastings" <[EMAIL PROTECTED]> writes:
>
> > On Thu, 04 May 2006 07:02:43 +1000, Gary Wessle wrote:
> > > b = 3
> > > def adding(a)
> > > print a + b
> > >
> > > it seams not to see the up-leve
"Steve R. Hastings" <[EMAIL PROTECTED]> writes:
> On Thu, 04 May 2006 07:02:43 +1000, Gary Wessle wrote:
> > b = 3
> > def adding(a)
> > print a + b
> >
> > it seams not to see the up-level scope where b is defined.
>
> Assuming you put a ':' after the "def adding(a)", this should work in
>
Gary Wessle <[EMAIL PROTECTED]> writes:
> is the code below correct?
It's best to post an example that you've tried yourself, and that is
small but completely demonstrates the issue in question.
> b = 3
> def adding(a)
> print a + b
This, for example, would fail the syntax check (the 'def'
On Thu, 04 May 2006 07:02:43 +1000, Gary Wessle wrote:
> b = 3
> def adding(a)
> print a + b
>
> it seams not to see the up-level scope where b is defined.
Assuming you put a ':' after the "def adding(a)", this should work in
recent versions of Python. In Python 2.0 and older, this will not
In <[EMAIL PROTECTED]>, Gary Wessle wrote:
> is the code below correct?
No...
> b = 3
> def adding(a)
...a colon is missing at the end of the above line.
> print a + b
>
> it seams not to see the up-level scope where b is defined.
It does. And you could easily find out yourself by just
11 matches
Mail list logo