Go to Google Groups Home    comp.lang.python
Re: ten small Python programs

Steve Howell <showel...@yahoo.com>

--- Wildemar Wildenburger <wilde...@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