GBGS SGHENE BPLCK205B/ BPLCKB205
USN
Dee.2023/Jan.2024
Second Semester B.EJB.Tech. Degree Examination,
Introduction to Python ProgrammingMax. Marks: 100
Time: 3 hrs.
question from each module.
Note: 1. Answer any FIVE fullquestions, choosing ONE full
2. M: Marks, L: Bloom 's level, C: Course outcomes.
M
Module -1 CO1
Q.1 Explain Local and global variable and scope of variable in python
LI COI
operators
b List and explain with example diflerent comparison and Boolcan
5 L3 CO1
C. Write apython program to generate Fibonalli sequence of length 'n
OR
in 10 LI CO1
Q.2 List and explain with syntax and example the low control statenent
python.
L2 CO1
Demonstrate with example print( ), input( ) and string replication function6
in python.
4 L3 CO1
C. Develop a program to read the name and year of birh ofa person. Display
weather person is senior citizen or not?
Module-2
a. What is a list? Explain append( ). insert( ), and remove methods with 10 | LI CO2
Q3
example.
b. Explain the methods of list data types in python for the following 10 LI CO2
operations with suitable code snippet for cach.
i) Adding value to list
ii) Remaining value from list
iii) Finding a value in a list
iv) Sorting the value in a list
v) Reversing a value in list
OR
Q.4 Explain get( ), item( ), keys( ) and values( ) methods of dietionary n L2 C02
pyhon.
b How is tuple different from list? Which tunction is used to convert ist to LICO2
tuple?
C. Differentiate between list and dictionary. L2 C02
Module -3
Q.5 a. Explain the syntax and example various string methods. LICO3
b. Discuss the following methods of OS module 8 L|CO3
i)chdir( ) ii) rmd1rt ) i) walk( ) iv) list dire )
Iof2
Read multidigit number from console. Develop a program to print 5 L3 CO3
fcqueney of occuTence of each digit with suitable message.
OR
Q. xplam Hle reading and writing process with suitable python program. 7 L3 CO3
b Wth code snippct, explain saving variables using shelve module and6 L2 C03
P a )and pint lomat( ) functions.
Wte apthon codeto implement multiclip board project in python. L3 CO3
Module-4
Q.7 a. Iplan the functions of shutil module with example. 10 L1 CO3
What is meant by compressing iles? Explain reading. extracting and 10 LI C03
crating zp liles with code snippet.
OR
Q.8 a. xplanthe following ile operationin python with example. 6 L CO3
) Copying tiles and folders
) Moving files and folders
m) Permancntly deleting files and folders
b. Deine assertions. What does an assert statement in python consists of?7 LI |C03
Gve an example.
C. Devclop a program to sort contents of a text file and write the forted 7 L3 CO3
content into a separate Iile.
Module-5
Q.9 a. Ixplain operator overloading and polymorphism with example. 7 CO4
b. Explain the concept of pure functions and modifiers with python code. 7 LI C04
Write a function called print time that takes a time object and print it in the6 L3 C04
form of hour: minute: second?
OR
9.10 a. What is class? How do we define class? How class members are accessed, LI C04
cxplain with examples.
LI C04
b. xplan --initt ) and - str( ) method with an example.
6 L1 C04
C.
Dscuss Iype based dispatch in python.
2of2