The In[]:
is how some interactive environments put the prompt for you to type a Python expression. It is in place of the >>>
, that you see when you call "Python" or "Idle".
Already the Out[]
is just a prefix to the return value of an expression. They are used in Jupyter Notebook, but also in "ipython" which can be used in the shell (cmd in windows), in place of normal Python.
In practice, if it’s an example of interactive elements, you just type in everything that comes after the In[]:
after the >>>
of your Python.
Also I recommend using the ipython, without the notebook itself, in place of the standard interactive environment (The Python executable that runs from the inside is the same - you only get a few more features - in particular, you can interactively edit blocks of code, which the default environment forces you to edit line by line). Just type pip install ipython
and call "ipython" instead of "python3".
Another advantage of ipython compared to normal shell is that the presence/absence of the
Out[]
makes it clear when a value is returned and when it is printed, which tends to confuse enough for those who are starting.– jfaccioni