problem using using list with function

Ignacio Vazquez-Abrams ignacio at openservices.net
Wed Oct 10 18:41:49 EDT 2001


On Wed, 10 Oct 2001, adam griffin wrote:

> I think I figured out my problem. I had the function definition at the end
> of my script when I put it at the beginning it worked. is this the only
> place you can put definitions?

No, but you have to define a function before you can use it.

Note that "using it" is defined as calling it, not just spelling it out, so
the following works just fine:

---
>>> def a():
...   b()
...
>>> def b():
...   print 'Blah!'
...
>>> a()
Blah!
>>>
---

-- 
Ignacio Vazquez-Abrams  <ignacio at openservices.net>





More information about the Python-list mailing list