Now a days Python comes under two major version Python2.0 and Python 3.0. There are some subversion on major version like Python 3.5, Python 3.5.10, Python 3.8.6, Python 3.9.0, and Python 3.9.1 etc.
There are two Programming modes of Python:
- Interactive Mode: This mode is used for exploring python syntax, seek help, and debug short programs.
- Script Mode: This mode is used for testing full-fledged Python Program.
When Python 3 is installed on computer, an interactive mode called IDLE (Python Integrated Development and learning Environment) is also installed on your computer which lets you to create, edit, and run your Python code. Python is the name of programming language and IDLE is name given to built-in Python IDE. IDLE takes your python code and run through its interpreter.
The first mode is or window is Python cell, which is REPL environment and is used to run snippets of python code, like a single statement at a time.
When you start IDLE on your computer, and then use the File | New File, menu option, to open a new editing window. Once you do, it will open two windows: one is Python cell and another is called Untitled.
If you want to use IDLE first on window:
- It can be located in windows by typing IDLE and double click it.
- Once you do the first step, it will open the python shell window showing >>> python cell prompt.
For Second window , it is text editing windows that is used to write a complete Python programming, it lets you to save it by <Filename>.py in NetBeans or Visual Beans.
Once file is ready and it can be executed by using F6 in NetBeans or Ctrl F5 in Visual Studio and then result is shown.
Let’s understand one Python program and see how Python Interpreter works
Save this Program to file name main.py and then run it in Python Compiler by pressing F5 to ask IDLE to execute your code.
Here in this program, there are some different methods used to print different statement. Once this program is run, the Python interpreter runs your code from top to bottom, one line at a time.
Python comes with a Powerful standard library, which provides access to lots of reusable modules which we will discuss later in other sections.