[Tutor] REport Card Question

Wayne Werner waynejwerner at gmail.com
Tue Nov 30 03:42:42 CET 2010


On Mon, Nov 29, 2010 at 8:28 PM, Robert Sjöblom <robert.sjoblom at gmail.com>wrote:

> <snip>
>
> On a related note, do all functions implicitly contain "return None"
> in them? Trying out this function (correctly) would get "None" added,
> such as:
> Enter grade:76
> B, Try Harder
> None
>
> Is there a way to avoid "return None" without explicitly having the
> function return something? Even an empty string will return a new
> line.
>

AFAIK, no. Nor am I sure why you would want to - None is a singleton so
there can only be once instance of it at a time. None is only printed when
you're working in the interactive interpreter - if you write the program in
a .py file and execute it you won't see the 'None' unless you print the
result (which would indeed be None!)

HTH,
Wayne
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20101129/605f0965/attachment.html>


More information about the Tutor mailing list