Python 2.1 - Writing first Python program
Before writing our first Python program, let’s first understand how to install Python software in our computer/laptop. I will not recommend Tablet and mobile for programming. First of all, go to link https://www.python.org/downloads/ and download Python software. Python comes in many versions such as 1.x, 2.x and 3.x where x represents version number. This book uses the latest version 3.8.3 of Python. You can download the latest version. Python 1.x and 3.x have some notable differences. For example, in Python 1.x we used print statement without parentheses and in Python 3.x we use print with parentheses.
In Python 1.x –
>>> print “this is a statement”
Whereas in Python 3.x –
>>> print(“this is a statement”)
You can download Python for Windows, Linux/Unix, Mac or any
other operating system. We are using Python for Windows 10(64 bit).
Installing Python on windows
First of all, check your OS. Then go to the link mentioned above and click on download Python. If you are using Windows, then click on Download Python for windows. If you are using some other operating system, then download Python for that particular OS. If you are having any problem installing the Python for other operating systems, then just Google “How to install Python on Linux/Mac”.
After downloading the Python software, double click on it to run the software. It should look like this –
Make sure that you check the box “Add Python 3.8 to PATH” to
add Python to system variable. This option allows you to execute your Python
programs from system’s Command prompt. And more important that we can download
Python libraries through ‘pip’ command. We will discuss about pip in a while.
Now click on “Install Now” and wait for it to install Python.
Testing installation
After successfully installing Python, we should check if it
is properly installed. To check, click on start button of your computer or
laptop and you will see following icons in “Python 3.8” folder –
·
IDLE (Python 3.8 64 bit)
·
Python 3.8 (64 bit)
·
Python 3.8 Manuals (64 bit)
·
Python 3.8 Module Docs (64 bit)
Comments
Post a Comment