You are on page 1of 5

Class Notes

Class: XI Topic: Getting started with Python

Subject: Informatics Practices

Python is an interpreted, high level programming language designed to be easy to read and simple to
implement. It is an open source, which means it is free to use. It was created by Guido Van Rossum and
released in 1991.

Advantage of Python:

a) Easy to use
b) Expressive language
c) Interpreted Language
d) Its Completeness
e) Cross platform independent
f) Free and open source
g) Variety of Usage/Application

Disadvantage of Python:

a) Not the fastest language


b) Lesser libraries than C, Java, Perl.
c) Not strong on Type-binding
d) Not easily convertible

Working in Python:

Before you start working in Python, you need to install Python on your computer. There are multiple
Python distributions available today. Default installation available from www.python.org

Steps to install Python:

Open the browser and type: www.python.org

Click Python Download. The following page will appear in your browser.

Click the Windows link (two lines below the Download Python 3.7.4 button). The following
page will appear in your browser.
Click on the Download Windows x86-64 executable installer link under the top-left Stable
Releases. The following pop-up window titled Opening python-3.74-amd64.exe will appear.

1. Click the Save File button.


The file named python-3.7.4-amd64.exe should start downloading into your standard
download folder. This file is about 30 Mb so it might take a while to download fully if
you are on a slow internet connection (it took me about 10 seconds over a cable modem).
The file should appear as Python-3.7.4-amd64.exe

2. Move this file to a more permanent location, so that you can install Python (and reinstall
it easily later, if necessary).
3. Feel free to explore this webpage further; if you want to just continue the installation, you
can terminate the tab browsing this webpage.
4. Start the Installing instructions directly below.

Installing

1. Double-click the icon labeling the file python-3.7.4-amd64.exe.

A Python 3.7.4 (64-bit) Setup pop-up window will appear.

1. Ensure that the Install launcher for all users (recommended) and the Add Python 3.7
to PATH checkboxes at the bottom are checked.

If the Python Installer finds an earlier version of Python installed on your computer,
the Install Now message may instead appear as Upgrade Now (and the checkboxes will
not appear).

2. Highlight the Install Now (or Upgrade Now) message, and then click it.

When run, a User Account Control pop-up window may appear on your screen. I could
not capture its image, but it asks, Do you want to allow this app to make changes to
your device.

3. Click the Yes button.

A new Python 3.7.4 (64-bit) Setup pop-up window will appear with a Setup
Progress message and a progress bar.
During installation, it will show the various components it is installing and move the progress bar
towards completion. Soon, a new Python 3.7.4 (64-bit) Setup pop-up window will appear with
a Setup was successfuly message.

Click the Close button. Python should now be installed.

Goto start and Click on IDLE (Python 3.7 64-bit) and you can see the installed software.

Once you have installed Python on your computer, you are ready to work on it. You can work in
Python in following different ways:

a) Interactive mode b) Script mode

Interactive Mode: In interactive mode, one command can run at a time and commands are not saved.

Script mode: All the commands are in the form of a program file and can see output of all lines together.

Understanding First program/script:

Let us create our first program – a simple: ”Hello World”. (We are using Python IDE for this.

Open the program from the start and select IDLE (Python 3.7 64-bit)
Click on File – New File and write the code

print(“Hello World”)

Save the file as first.py (.py is the extension of python) and run by pressing F5 key and you will get the
output as below.

So try another program: Program 1: Write a program to display your name.

Click on File – New File and write the code

Name="Anurag Singh"
print("My name is", Name)

#Save the file as name and press F5 to run the program.


Output will be :
My name is Anurag Singh

Program 2: Write a program to add two numbers.

A=10
B=12
C= A+B
print(C)

#Save the file as add.py and press F5 to run the program


Output will be : 22

Assignment: Write a program for (Subtraction(-), Multiplication(*), Division ( / ))

Note: ‘Content developed/prepared absolutely from home.

You might also like