Last Updated on July 29, 2023
Modes of Python Program :
We can develop a python program in 2 different styles.
- Interactive Mode and
- Batch Mode.
Interactive Mode :
Interactive mode is a command line shell. If we write a python program in the command line shell.
Typically the interactive mode is used to test the features of the python, or to run a smaller script that may not be reusable.
Example for Interactive Mode :
Open the command prompt, and go to the location which your python has been installed and hit the python command.
On the above example, I have executed some arithmetic operations on the python command shell.
Batch Mode :
Batch mode is mainly used to develop business applications. In batch mode, we can write a group of python statements in any one of the following editors or IDEs
- Netbeans Etc..
We can write our python programs any one of the above Editors/IDEs.
Example for Batch Mode:
i=100 j=200 print i+j print i-j print i*j
After writing the above code on any favourite editor, save it with the extension of either .py or .pyw.
Then run the above python program by passing the below command on your terminal.
chandrashekhar@goka:~/Documents$ python demo.py 300 -100 20000