[Tutor] No return statement

Cecilia Alm ebbaalm at uiuc.edu
Tue Apr 24 19:16:31 CEST 2007

My apologies for asking a trivial question about programming practice.

As mentioned in the online tutorial
functions which lack a return statement ('procedures') actually return "None".
For such functions, I assume it's preferred to not catch "None" in a variable.

>>> def printme(x):
	print x

Preferred function call:	
>>> printme(10)

Alternative (where None is caught into z):
>>> z = printme(10)
(And then one could print None)
>>> print z

More information about the Tutor mailing list