BET’s
BASAVAKALYAN ENGINEERING COLLEGE, BASAVAKALYAN
Subject: Python Department of Computer Science AcademicYear:2025-26
Programming
Branch: CR Assignment -4 Section: C Section
Date:12/12/2025 Subject Code: 1BPLC105B
Q.. MODULE-4
1 Explain the use of random and time modules in Python. Develop a program that simulates a simple
stopwatch that records random time intervals and calculates the average elapsed time.
2 Explain the concept of namespaces in Python. Develop program to illustrate how variable lookup follows the
LEGB (Local, Enclosing, Global, Built-in) rule.
3 Differentiate between class attribute and instance attribute with suitable program segments
4 Develop python script to create a module [Link] with functions for square, cube, and factorial of a
number. Import it in another file using all three import variants. Demonstrates the usage of each of the
imported function
5 Develop a custom module having function which calculates factorial of a number. Import this custom
module to a program to calculate binomial coefficient.
6 Explain the difference between ‘is’ and ‘==’ operators using immutable objects.
7 Explain math module with example?
8 What are the variance of writing import statements?
9 Describe mutable versus immutable with example?
10 What is class and oops? write a python program for it.
11 Write a python program for user defined compound datatype.
12 Write a python program for calculating distance from origin.
13 Describe instance as arguments and parameters ?convert instance to a string.
14 Explain instances as return values and write a python program for calculating the midpoint.
BET’s
BASAVAKALYAN ENGINEERING COLLEGE, BASAVAKALYAN
Subject: Python Department of Computer Science AcademicYear:2025-26
Programming
Branch: CR Assignment -5 Section: C Section
Date:28/12/2025 Subject Code: 1BPLC105B
Q.. MODULE-5
1 Create a Python class Point with attributes x and y. Demonstrate sameness using ‘is’ operator, and show the
effect of mutability when modifying one reference.
2 Explain the need for exception handling in Python. Develop a program to illustrate: try, except, else, and
finally blocks.
3 What is operator overloading? Illustrate with example using __add__().
4 Develop a program to illustrate polymorphism by defining a common interface method in two different
classes.
5 Outline the difference between pure functions and modifiers. Develop a program code illustrating both using
a class Bank Account.
6 Explain the role of finally clause with an example.
7 Explain sameness with examples.
8 Explain copying with example.
9 Explain generalization and explain two different ways of solving problems.
10 Write a program to demonstrate raising a user defines exception in python.
11 Explain the concepts of mutable objects in python.