ten small Python programs

Wildemar Wildenburger wildemar at freakmail.de
Sun May 27 11:45:52 EDT 2007


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"?

W



More information about the Python-list mailing list