On 07/04/18 01:50, Roger Lea Scherer wrote:
> So I've examined my educational material, I've perused the python
> documentation and for the life of me I can't figure out why return doesn't
> print a result in the IDE. I use print, the program acts as expected. What
> am I missing?

The fact that return doesn't print anything it just returns
a value to the caller.

I suspect that you are getting confused by the behaviour of
the interactive prompt (>>>) which automatically prints
results.  But that is purely a feature of the >>> prompt
designed to make developing/debugging code easier.

In regular Python code execution values are only printed
when you ask for them to be by using print. And if you
think about it, that's a good thing, otherwise the screen
would quickly fill with a mess of intermediate values
the user doesn't need.

Alan G
Author of the Learn to Program web site
Follow my photo-blog on Flickr at:

Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:

Reply via email to