Problem Solving and Python Programming: UNIT II: Data Types, Expressions, Statements

How to Write and Execute Python Program

The executable file Python 3.7.3.exe will get downloaded on your PC. Now double click this executable file to install Python. For 64-bit architecture, select Windows x86-64 executable installer.

How to Write and Execute Python Program

First, download the latest version of Python from the official website. For that purpose open the web site https://www.python.org


Now Select the file based on architecture of your PC. For Windows it can be 32 bit or 64 bit. If it is 32 bit then select the file as shown in the following screen shot


The executable file Python 3.7.3.exe will get downloaded on your PC. Now double click this executable file to install Python. For 64-bit architecture, select Windows x86-64 executable installer.

Then following screen will appear. Just check the add path checkbox and click Install Now. The illustrative screenshot will help you.


The installation will progress.


Finally you will get successful installation message.


Congratulations!!!. The Python is installed on your PC. Now you can write and execute the programs in Python using Python Shell.

Go to the List of Applications in your PC, Locate Python, either click on Python or IDLE to get the shell prompt. I use Python IDLE. The shell prompt appears as follows -


The python shell will be displayed and >>> prompt will be displayed. One can type different programming constructs and get the instant result of the command entered.

For example -


In above command we have used print command to display the desired message at the prompt.

The last line is a prompt that indicates that the interpreter is ready for you to enter code. If you type a line of code and hit Enter, the interpreter displays the result.

For example -


 

Problem Solving and Python Programming: UNIT II: Data Types, Expressions, Statements : Tag: Engineering Python : - How to Write and Execute Python Program