Python Console
Console in Python is referred as the command line Interpreter- (CLI) and also knows as Shell and it functions as taking input from the human user and interpreting it through the commands given to it. And after interpreting it throughout if it goes error free, it will give the desired output or else shows up error on the display.
When we open the console of the python, we get an interactive console display at first which guides us the whole about the modules and packages in the python.
The main feature of the python console is it helps the programmer to get quick way to code and test it without even creating a new file (or) directory. Console is the cause for performing the operations on inputs and the outputs of the code respectively.
Python console when we open it firstly.

The first basic of the Python to learn coding is to learn about the minimum required knowledge about Python console and its commands and one of them is the code generator which is in the symbol like “>>> “. Here, In the space about in the shell we write our desired code and get the outputs.
Python has various types of built-in functions in it and the basic one to implement to take and read the input is – input ()
Example:
A = input () #used for taking input
Print( A) #desired output
OUTPUT:
>>>CONSOLE FOR PYTHON
‘CONSOLE FOR PYTHON’
Generally, the Python console is of two types:
- Interactive Mode
- Script Mode
Interactive Mode:
In this mode the console is interpreted by executing the commands and all types of expressions at the command prompt window. If we are not sure about the code and having a feeling of improving the code more optimistically, we can go with the interactive mode because it is very easily accessible and can perform any experiment on the code based on our requirements. It allows us to come along with the operating system and interact with it. Although we can save and edit the code in this mode but if we want retrieve and access the earlier data, have to retype it run them for the output. We get the results very immediately in this mode. This mode is suitable for writing small and short programmes. It is used more significantly when the user wants to run and execute the code which is of single line (or) a single block of code.
When we type the Python programs, either into the interactively or into a text file, we have to be confident to start all our unnested statements in starting from the very first left. If we fail to do it, Python compiler prints “Syntax Error” message on the output window, because empty space to the left of code is taken as indentation that altogether brings of nested statements.
Print statements are required only in files. Because the interactive interpreter automatically prints the results of expressions as we need not to type complete print statements for the output.
Note: Remember, we must say print in files, but not interactively.
Example:
>>>6
Output:
6
Input:
>>>print(8+6)
Output:
14
Input:
>>>”Python” * 2
Output:
‘pythonpython’
Input:
>>>print(4 * 6)
Output:
24
Script Mode:
Script mode enables us to create and edit python source file more significantly as in this mode we can create files and save for the future user reference. It is more likely to be used and suitable for writing and executing the long programs and no experiments can be done as that of the interactive mode because the editing the code is high level task as the lines of code are more in it.
Here, we take the help of script file such as Notepad and then save it and execute it after the clearing of the errors. This mode can be operated by two means that is Python IDE or the command Prompt.
Here, we save the file with extension ".py"
Script mode is only recommended when we are sure and clear about our code. We can save the lines of code for further use, and we need not to type as that of interactive and all the lines of code can be run again but here in this mode, we don’t get the output results immediately.
Example:
print(10)
X = 4
print(X)
OUTPUT:
>>>10
4
Console in Python is referred as the command line Interpreter- (CLI) and also knows as Shell and it functions as taking input from the human user and interpreting it through the commands given to it. And after interpreting it throughout if it goes error free, it will give the desired output or else shows up error on the display.
When we open the console of the python, we get an interactive console display at first which guides us the whole about the modules and packages in the python.
The main feature of the python console is it helps the programmer to get quick way to code and test it without even creating a new file (or) directory. Console is the cause for performing the operations on inputs and the outputs of the code respectively.
Python console when we open it firstly.

The first basic of the Python to learn coding is to learn about the minimum required knowledge about Python console and its commands and one of them is the code generator which is in the symbol like “>>> “. Here, In the space about in the shell we write our desired code and get the outputs.
Python has various types of built-in functions in it and the basic one to implement to take and read the input is – input ()
Example:
A = input () #used for taking input
Print( A) #desired output
OUTPUT:
>>>CONSOLE FOR PYTHON
‘CONSOLE FOR PYTHON’
Generally, the Python console is of two types:
- Interactive Mode
- Script Mode
Interactive Mode:
In this mode the console is interpreted by executing the commands and all types of expressions at the command prompt window. If we are not sure about the code and having a feeling of improving the code more optimistically, we can go with the interactive mode because it is very easily accessible and can perform any experiment on the code based on our requirements. It allows us to come along with the operating system and interact with it. Although we can save and edit the code in this mode but if we want retrieve and access the earlier data, have to retype it run them for the output. We get the results very immediately in this mode. This mode is suitable for writing small and short programmes. It is used more significantly when the user wants to run and execute the code which is of single line (or) a single block of code.
When we type the Python programs, either into the interactively or into a text file, we have to be confident to start all our unnested statements in starting from the very first left. If we fail to do it, Python compiler prints “Syntax Error” message on the output window, because empty space to the left of code is taken as indentation that altogether brings of nested statements.
Print statements are required only in files. Because the interactive interpreter automatically prints the results of expressions as we need not to type complete print statements for the output.
Note:Remember, we must say print in files, but not interactively.
Example:
>>>6
Output:
6
Input:
>>>print(8+6)
Output:
14
Input:
>>>”Python” * 2
Output:
‘pythonpython’
Input:
>>>print(4 * 6)
Output:
24
Script Mode:
Script mode enables us to create and edit python source file more significantly as in this mode we can create files and save for the future user reference. It is more likely to be used and suitable for writing and executing the long programs and no experiments can be done as that of the interactive mode because the editing the code is high level task as the lines of code are more in it.
Here, we take the help of script file such as Notepad and then save it and execute it after the clearing of the errors. This mode can be operated by two means that is Python IDE or the command Prompt.
Here, we save the file with extension ".py"
Script mode is only recommended when we are sure and clear about our code. We can save the lines of code for further use, and we need not to type as that of interactive and all the lines of code can be run again but here in this mode, we don’t get the output results immediately.
Example:
print(10)
X = 4
print(X)
OUTPUT:
>>>10
4