What Is In[] in Python

What Is In[] in Python

Am learning python by myself and I searched for in operator in net but I could not understand what it does exactly mean in here

In[11]:3+2
Out[11]:5
In[12]:print(3+2)
5

Please excuse my ignorance am just new to python.

1

2 Answers

They identifies cells in an iPython/Jupyter notebook. Cells enclosing input prompts use In[x], where x is just a serial number you can use to refer to previous inputs. Out[x] is the cell containing the output of the corresponding In cell.

Your example shows an input of 3 + 2, following by its value. print(3+2) is likewise an input, but the 5 is simply text written to standard output. As the input expression had the value None (the return value of the print function), no output cell was created.

I believe you are typing this out in a Jupyter Notebook or a Python Editor. In and Out here means Input and Output.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Chloe Bennett
Author

Chloe Bennett

Chloe Bennett explores the intersection of pop culture, streaming entertainment, digital trends, and contemporary lifestyle. Her weekly commentary reaches thousands of culture enthusiasts.