Introduction to python programming
Introduction to python programming
pm
USN
5
Introduction to Python Programming
:5
Time: 3 hrs. Max. Marks: 100
1
:2
Note: 1. Answer any FIVE full questions, choosing ONE full question from each module.
2. M : Marks , L: Bloom’s level , C: Course outcomes.
H
01
-M
Module – 1 M L C
Q.1 a. List and explain the use of comparison operator in python. Write the step by 6 L1 CO1
4
step execution of the following expression in python.
H
02
3/2 * 4 + 3 + (10/4)**3 – 2
-M
-2
b. Explain the control statements, if, else, elif with proper syntax and 6 L2 CO1
examples.
H
02
-M
c. Develop a python program to calculate the area and circumference of a 8 L3 CO1
2-
-M
U
OR
Q.2 a. Explain the string concatenation and string replication operator with an 6 L2 CO1
VT
example.
m
-M
4p
b. Explain local and global scope of variable with suitable example. 6 L2 CO1
H
H
:5
c. -M
Develop a program to read the student details Like Name, USN and Marks 8 L3 CO1
-M
in three subjects. Display the student details, total marks and percentage
34
-M
:
01
-M
Module – 2
Q.3 a. What is list? Explain the concept of list indexing and slicing with examples. 6 L2 CO2
H
24
H
-M
b. With suitable examples, explain the list methods append( ), extend( ), 8 L2 CO2
-M
H
H
c. Read N numbers from the console and create a list. Develop a program to 6 L3 CO2
-M
2-
-0
H
12
OR
-M
Q.4 a. Define tuple data type? List out the difference between tuple and list. 6 L2 CO2
H
b. Identify and explain the dictionary methods like get( ), item( ), keys( ) and 8 L2 CO2
-M
1 of 2
H
-M
H
M
BPLCK105B/BPLCKB105
Module – 3
Q.5 a. Write the output of the following : 6 L2 CO3
pm
i) ‘HeLLo’ upper( ) isupper ( )
ii) ‘HeLLo’ upper( ) lower( )
iii) ‘__’ Join(‘There can be only one’ split( ) )
5
:5
b. With examples, explain any five string methods. 6 L2 CO3
1
c. Develop a python program to count the total number of vowels, consonants 8 L3 CO3
:2
in a string.
H
01
OR
-M
Q.6 a. Make use of the concept of file handling and explain Reading and writing 7 L2 CO3
process with suitable python programs.
H
02
b. Explain the concept of file path, also discuss absolute and relative paths. 7 L2 CO3
-M
c. -2
Briefly, explain saving variables with shelve module. 6 L2 CO3
H
Module – 4
02
-M
Q.7 6 L2 CO3
i) Copying files and folders
2-
-M
U
b. List out the benefits of compressing file with zip file module, also explain 8 L2 CO3
the concepts of walking a directory tree.
VT
m
-M
H
OR
H
:5
34
b. Develop a python program with a function named DivExP which takes two 8 L3 CO3
H
H
has to read two values from the console and call a function DivExP.
H
24
H
Module – 5
20
Q.9 a. Define classes and objects in Python. Construct the class called rectangle 8 L2 CO4
H
-M
2-
rectangle.
-0
-M
OR
-M
Q.10 a. Explain the term objects are mutable with an example. 6 L2 CO4
b. Explain the concept of polymorphism with examples. 8 L2 CO4
H
*****
2 of 2
H
-M
H
M