XI-IP-I-Getting Started With Python-Module 5-5-2021
XI-IP-I-Getting Started With Python-Module 5-5-2021
Basics of Python programming, Python interpreter - interactive and script mode, the structure of a program,
indentation, identifiers, keywords, constants, variables, types of operators, precedence of operators, data
types, mutable and immutable data types, statements, expressions, evaluation and comments, input and
output statements, data type conversion, debugging.
Python was named after famous BBC comedy show namely Monty Python’s Flying Circus. Original release
- Oct 1969 -1974
Pluses/Features of Python :
1.Easy to use OO language- It is compact and very easy to use object oriented language with very simple
syntax rules.
2. Expressive language- It is more capable to express the codes purpose than any other language
because of fewer lines of code, simpler syntax. Less code to be written as it itself express the purpose of
the code.
For example:
In C++:Swap values In Python: Swap values
int a = 2, b=3,tmp; a,b=2,3
tmp=a; a,b=b,a
a=b;
b=tmp;
3. Interpreted language- Python installation interprets and executes the code line by line at a time.
4. Completeness – Support wide range of library
5. Free & Open Source – Can be downloaded freely and source code can be modify for
improvement.
7. Variety of usage-
LIMITATIONS OF PYTHON
1. Not the fastest Language Its not fully compiled one as its interpreter based. Its first semi-complied into
an internal byte code which is then exerted by a Python Interpreter. Execution times are not that fast as
3. Weak / Not strong at Type-binding – It not pin point on use of a single variable for different
data type.
4. Not easily Convertible-Because of its lack of syntax, Python is an easy language to program in.
Python installation process
Note – Download only that python distribution/MSI Installer, which is best suited for the
Operating system on which you want to install it.
If the Python Installer finds an earlier version of Python installed on your computer, the Install Now message will
instead appear as Upgrade Now(and the checkboxes will not appear).
3. User Account Control pop-up window will appear
4. A new Python <version> Setup pop-up window will appear with a Setup
python<version>->IDLE(Python GUI)
Python Prompt
print 8*3
k=3+4*3
print k
(ii) in Script mode
Now type :
Print “hello”
Print “world”
c. Click File->Save and then save the file with filename and .py extension
a. Click Open command from IDLE’s File menu and select the file
you have already saved
Page 13 of 14
Assignment Questions:
1. What is Python?
2. What is the purpose of PYTHONSTARTUP environment variable?
3. Evaluate the output generated
>>>print 3.14159* 7**2
>>>print “I”, “am” + “class XI”, “student”
>>>print “I‟m”,
>>>print “class XI student”
>>>print “I‟m “, 16, “years old”
Page 14 of 14