0% found this document useful (0 votes)
5 views1 page

Python Programming Exam Questions 2025

The document outlines the Term End Examinations for the CSE3011 Python Programming course, detailing various topics such as Object-Oriented Programming principles, class creation, access specifications, and exception handling. It includes specific questions that require students to demonstrate their understanding through coding tasks and explanations. The examination covers practical applications of Python concepts, including class design, operator overloading, and error handling.

Uploaded by

manage.raaz
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

Python Programming Exam Questions 2025

The document outlines the Term End Examinations for the CSE3011 Python Programming course, detailing various topics such as Object-Oriented Programming principles, class creation, access specifications, and exception handling. It includes specific questions that require students to demonstrate their understanding through coding tasks and explanations. The examination covers practical applications of Python concepts, including class design, operator overloading, and error handling.

Uploaded by

manage.raaz
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Term End Examinations – Interim Semester 2025-26 - December 2025

Course code : CSE3011 Slot : A14+B14+B22+C14+E14


Course Title : Python Programming Prepared By: Dr. C.K. Behera (SCOPE)
UNIT-3: Principles of Object Orientation, Classes in Python, Creating Classes, Instance
Methods, Access Specification, data modeling, persistent storage of objects, inheritance,
polymorphism, operator overloading, abstract classes, exception handling, try block
S. No. Questions Marks
Explain the Principles of Object-Oriented Programming with reference to Python. Discuss
1 encapsulation, abstraction, inheritance, and polymorphism, highlighting how Python
supports each principle with suitable examples.
Create a class named Circle with a radius attribute and two methods: one to calculate the
2 circumference and another to calculate the area. Write the Python code neatly with proper
indentation.
Discuss access specification in Python. Explain public, protected, and private members with
3
appropriate naming conventions. Illustrate your answer with a Python program.
Write a Python class named ShoppingCart that represents a simple online cart system.
The class should allow users to add items (each with a name, unit price, and quantity),
remove items by name, and compute the subtotal of all items based on their quantities.
It must also support applying discount codes (SALE10 for 10% & FESTIVE20 for 20%)
dynamically. Invalid codes should be handled gracefully without applying any discount.
4
After implementing the class, write a test script that demonstrates adding multiple items,
removing items, computing the subtotal, applying each of the discount codes, attempting to
apply an invalid code, and finally displaying the subtotal, discount amount, and total payable
amount in a clear output format.
Explain the concept of abstract classes in Python. Discuss the role of the abc module. Write a
5
Python program demonstrating the use of abstract methods and class inheritance.
Write a Python class called TaskManager that stores a list of tasks, where each task is
represented by a task_name and a completion_status. The class should provide
methods to add a new task, mark a task as completed, and display all tasks that are still
6 pending.
After implementing the class, write a short test program that creates a TaskManager object,
adds a few sample tasks, marks one task as completed, and prints the list of pending tasks to
show that the class works correctly.
Explain operator overloading in Python.
7 Create a Box class that stores the length of a box. Overload the ‘+’ operator so that adding
two Box objects produces a new Box object whose length is the sum of the two lengths.
Describe the difference between @classmethod and @staticmethod. Give a use-case
8
where @classmethod is strictly preferred and explain why.
Differentiate between compile-time errors and runtime errors. Explain how Python handles
9
runtime errors using exception handling mechanisms. Illustrate with a suitable program.

You might also like