Now a days, many PCs have Python already installed inside it. So, to find out whether our Windows PC have Python installed in or not, go to the Start bar and search by following commands to type on command line: C:\users\your names>python--version
To check in Linux, open the command line and in Mac open the terminal and type: python --version.
If our PC don't have Python installed in it, then install it free from internet by following website:
https:///www.python.org/
Run a Python file:
Python is an interpreted programming language. We can write a Python file in a text editor and put this file into the Python interpreter to be executed.
The way to run a Python file on command line is:
c:\user\name>filename.py
Here file name is the Python file name.
We will discuss here Python version 3.11.5. Python interpreter enables to run the program on the computer. IDLE (Graphic User Interface) is the standard 'Python Development Environment', to write the codes.
Python 3.11 is 10-60% faster than Python 3.10.
Lets start writing a simple Python program:
Go to search box, type 'idle'. Now click it to open and go to the interactive interpreter prompt.
Bravo, this is the first Python program, we have written and run successfully.
Try it yourself
Run Python in your browser
In above editor try any string value instead of 'Hello World' and click 'Run' button. To delete the previous outputs click 'Clear History'. You can run any numeric value too.
To install python3 on MacOS, visit the link https://www.javatpoint.com/how-to-install-python-on-mac.
To install Python3 on CentOS, visit the link https://www.javatpoint.com/how-to-install-python-on-centos.