Output showing "None" in Terminal

Terry Reedy tjreedy at udel.edu
Tue Aug 25 21:06:51 EDT 2020


On 8/24/2020 4:41 PM, Calvin Spealman wrote:

> "None" is the default return value of all functions in Python. But, the
> interpreter is supposed to suppress it as a displayed result.

In batch mode, expressions are not echoed.  In interactive move, 
expression values other than None are echoed.  The string 'None' is not 
suppressed.

Type "help", "copyright", "credits" or "license()" for more information.
 >>> None  # Not echoed.
 >>> str(None)  # Not echoed in batch mode.
'None'
 >>> repr(None)  # Ditto.
'None'
 >>> print(None)  # Always printed to valid sys.stdout.
None

-- 
Terry Jan Reedy



More information about the Python-list mailing list