On Sun, Jan 23, 2011 at 11:52 AM, CM <cmpyt...@gmail.com> wrote: > On Jan 23, 2:38 pm, "Littlefield, Tyler" <ty...@tysdomain.com> wrote: >> The return value simply returns a value to the calling function, which >> the function can handle, however it wants. so: for example >> def add(a, b): >> return (a+b) >> >> That simply returns the value a+b, which you can use however you like, >> like so: i=add(2,3) will assign the return value to add. > > And return doesn't have to return a value(s).
Pedantic nitpick: Technically it does; you're just not required to always explicitly provide one. Python uses None if you don't specify anything (i.e. a bare `return` === `return None`). By definition, every function returns *some* value. Cheers, Chris -- http://blog.rebertia.com -- http://mail.python.org/mailman/listinfo/python-list