What does a function do?

Christopher A. Craig ccraig at ccraig.org
Tue Apr 24 08:55:10 EDT 2001


James Logajan <JamesL at Lugoj.Com> writes:

> Some functions don't return values; sometimes they send information off
> somewhere else.

By my definition, functions always return values.  Regardless of my
thoughts on the matter though, Python functions always return a
value.  In some cases that value is always None, but there is always a
return value.

>>> def foo(a):
...    print a+5
...
>>> t = foo(5)
10
>>> t is None
1
>>>


-- 
Christopher A. Craig <ccraig at ccraig.org>
"I don't know of any version of Unix on Intel that is not technically superior
to Windows NT."  --  Nicholas Petreley (InfoWorld Columnist)



More information about the Python-list mailing list