Year-2024 Term-241
DR S& SS GHANDHY COLLEGE OF ENGINEERING AND TECHNOLOGY, SURAT
INFORMATION & TECHNOLOGY DEPARTMENT
DIPLOMA ENGG – 3rd SEMESTER
ASSIGNMENT:-2
SUBJECT NAME: - DATA STRUCTURE WITH PYTHON SUBJECT CODE: - 4331601
CO-1: Implement Object Oriented Programming concepts in Python. Date: 23/08/2024
Q:-1 Differentiate following: - (3 marks each)
1. Class Method Vs Instance Method.
2. Method Overriding Vs Method Overloading.
Q: 2 Explain following :- (3/4 marks each)
1. Explain the concept of class and object in python with suitable example.
2. List out types of constructor. Explain Default Constructor with suitable example.
3. Explain instance method with suitable example.
4. Explain Class method with suitable example.
5. Explain static method with suitable example.
6. Explain access specifier in python with suitable example.
7. Define: super() function. Explain use of super class with example.
8. Explain polymorphism in class with example.
9. Explain how method overloading achieve in python using suitable example.
10. Explain working with abstract class in python with suitable example.
11. Explain Abstract Base Class (ABC) module.
12. Explain method overriding in python with suitable example.
13. Write a python program to create a Bus object that will inherit all of the variables and methods of the
parent Vehicle class and display it.
Q: 3 Explain following programs: - (7 marks each)
1. Define Constructor. Explain non-parameterized and parameterized constructor with suitable
example.
2. Design a student class for reading and displaying the student information, the getInfo() and
displayInfo() methods will be used respectively.
3. Write a Python program to demonstrate method overriding using inheritance.
4. Define Inheritance. Explain Single and multiple inheritance with suitable example.
5. Explain multilevel and hierarchical inheritance with suitable example.
6. Write a Python class, Flower, that has three instance variables of type str ,int, and float, that
respectively represent the name of the flower, its number of petals, and its price. Your class must
include a constructor method that initializes each variable to an appropriate value, and your class
should include methods for setting the value of each type, and retrieving the value of each type.