When starting IPython, if you evaluate the semicolon, you get the return value of the empty string, as shown below. What for? My theory is that IPython removes the line terminator in the statement, but that still doesn't explain why it returns the string.
$ ipython Python 2.7.12 (default, Oct 11 2016, 05:24:00) Type "copyright", "credits" or "license" for more information. IPython 5.1.0 -- An enhanced Interactive Python. ? -> Introduction and overview of IPython features. %quickref -> Quick reference. help -> Python own help system. object? -> Details about 'object', use 'object??' for extra details. In [1]: ; Out[1]: ''
This also works in IPython for Python 3.
Edit: Sorry, it must have been clearer: this does not work in the standard Python shell, only in IPython.
source share