Bapuji Educational Association ®
Bapuji Institute of Engineering and Technology, Davangere – 577 004
VTU Affiliated Autonomous Institute
Common to All Branches
Course Title/Type/Category Python Programming (Integrated, PLC) Course Code BCSPLC215P
Course Coordinator Semester/Section 2nd
MODULE 4- QUESTION BANK
Mar
[Link]. Questions COs RBT
ks
Chapter 7.1-7.8
Define a file in Python. Explain different file opening modes with suitable
1 6 CO4 L2
examples.
Explain the functions read(), readline(), and readlines() used in file handling with
2 6 CO4 L2
examples.
3 How can a file be read line-by-line in Python? Illustrate with a suitable program. 6 CO4 L2
Explain how to convert the contents of a file into a list of lines in Python with an
4 6 CO4 L2
example.
Explain how Python accesses files stored in different directories using file paths
5 6 CO4 L2
with suitable examples.
Differentiate between text files and binary files in Python with suitable
6 6 CO4 L2
examples.
Write a Python program to count the number of lines present in a text file.
7 6 CO4 L3
Explain the program with suitable output.
8 Write a Python program to display only the even-numbered lines from a text file. 6 CO4 L3
Chapter 8.1- 8.4
Explain the steps involved in creating a user-defined module in Python. Illustrate
9 6 CO4 L2
with a suitable example program.
Explain how the time module is used to measure and compare the execution time
10 6 CO4 L2
of programs in Python with a suitable example
Write a Python program to fetch and display data from a webpage using the
11 6 CO4 L3
urllib and request module.
Explain mutable, immutable data types and aliasing in Python with suitable
12 examples. 6 CO4 L2
Write a Python program using the random module to simulate the rolling of a
13 6 CO4 L3
dice.
Write a Python program using the time module to display the current system
14 6 CO4 L3
time.
Bapuji Educational Association ®
Bapuji Institute of Engineering and Technology, Davangere – 577 004
VTU Affiliated Autonomous Institute
Common to All Branches
Course Instructor Course Co-ordinator Co-ordinator-DAAC Program Co-ordinator