Python installation and Setup

Now that you have downloaded Python let’s move on and install it . I am using the latest version i.e 3.7 .Now simply run the downloaded installer by double clicking the downloaded file. A window will prompt something like this:

please make sure you check the box –add Python 3.6 to PATH then just click install now.

Great ! so now few minutes later you will have Python installed on your system.

How to verify if Python is installed: now in order to check whether Python is installed open the command prompt and run the command

python — version

( for Windows )

It should show the version of python as a result if it is successfully installed. In our case it will show 3.x.x

IDLE is simple code editor for Python that comes bundled with Python. We are covering IDLE because it comes with Python, and because it is not too complex for beginning programmers to use effectively. You are welcome to use another editor or IDE if you wish. I would say that Pycharm is best suited for beginners. You can download Pycharm from here.

Read my article on top Python IDE’s and code editors.

Writing first “Hello World” program in IDLE

To start IDLE , in Windows open start -> All Programs -> search python IDLE and double click to open. Python shell will be opened .

You will see three arrows as below

>>>

Now type the first line as

print('Hello World')
       Or
print(" Hello World")

You can use either single quotes or double quotes.Save the file as hello.py

Run the file: in your terminal navigate to the directory which contains hello.py file and run the command

$python hello.py

hit enter and now you should see ‘ hello world’ printed on the console.

You can quit the Python shell by typing

exit() or quit () command
Try it yourself:
Open up the Python shell and try to print few lines about yourself 😊
So stay with me to learn more and click next to move forward to next topic!