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

Python Assignment 3

This document outlines Assignment #3 for a Python programming course, which consists of various questions related to object-oriented programming concepts such as classes, objects, inheritance, polymorphism, encapsulation, and method overriding. It also includes practical tasks to implement classes like Student, Shape, and Library with specific functionalities. The assignment is worth 25 marks and is due on April 25, 2025.

Uploaded by

omo00116
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)
4 views1 page

Python Assignment 3

This document outlines Assignment #3 for a Python programming course, which consists of various questions related to object-oriented programming concepts such as classes, objects, inheritance, polymorphism, encapsulation, and method overriding. It also includes practical tasks to implement classes like Student, Shape, and Library with specific functionalities. The assignment is worth 25 marks and is due on April 25, 2025.

Uploaded by

omo00116
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
You are on page 1/ 1

Python Programming

Assignment #3

Marks: 25 Due Date: 25/04/2025

-------------------------------------------------------------------------------------------------------
1. Explain the difference between a class and an object. [2]

2. What is inheritance in OOP? Provide an example. [2]

3. Describe polymorphism and give an example of how it can be implemented in Python.[2]

4. What is encapsula on and how does Python achieve it? [2]

5. Explain the concept of method overriding with an example. [2]

6. What is the purpose of the __init__ method in a class? [2]

7. How do you implement mul ple inheritance in Python? [2]

8. Implement a class Student that inherits from Person and adds an a ribute student_id.
Include a method to display the student's details, including the inherited a ributes. [3]

9. Create a class Shape with a method area that returns 0. Implement two
subclasses Circle and Rectangle that override the area method to calculate the area of
the shape. [4]

10. Define a class Library with methods to add books, remove books, and display all available
books. Each book should be represented by a class Book with a ributes tle, author,
and isbn. [4]

You might also like