ten small Python programs
Steve Howell
showell30 at yahoo.com
Sun May 27 12:48:43 EDT 2007
--- Wildemar Wildenburger <wildemar at freakmail.de>
wrote:
> Steve Howell wrote:
> > # def defines a method in Python
> > def say_hello(name):
> > print 'hello', name
> > say_hello('Jack')
> > say_hello('Jill')
> >
> Doesn't def define methods *xor* functions,
> depending on the context?
> And in this example, say_hello (*yuck*, underscores
> ...) is certainly a
> function. Or is it that functions are considered
> "module-methods"?
>
Goodness, I didn't expect such a simple example to be
so controversial. But please see the new version
here:
http://wiki.python.org/moin/SimplePrograms
I changed the method name to "greet" and removed the
comment, as hopefully the intent of the program will
be pretty obvious to anyone that reads it.
____________________________________________________________________________________Luggage? GPS? Comic books?
Check out fitting gifts for grads at Yahoo! Search
http://search.yahoo.com/search?fr=oni_on_mail&p=graduation+gifts&cs=bz
More information about the Python-list
mailing list