0% found this document useful (0 votes)
32 views

Classes and Objects

The document discusses various examples of using classes and objects in Python programs. It includes programs that define classes like Student and Bank, with instance methods to process data. It also covers inheritance concepts like single inheritance with subclasses derived from a base class, multiple inheritance using two base classes, and overriding methods. The last few examples focus on hierarchical and multilevel inheritance involving passing values to base class constructors.

Uploaded by

nanekaraditya06
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views

Classes and Objects

The document discusses various examples of using classes and objects in Python programs. It includes programs that define classes like Student and Bank, with instance methods to process data. It also covers inheritance concepts like single inheritance with subclasses derived from a base class, multiple inheritance using two base classes, and overriding methods. The last few examples focus on hierarchical and multilevel inheritance involving passing values to base class constructors.

Uploaded by

nanekaraditya06
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

*** Classes and objects ***

1. A python program to define Student class and create an object to it. Also
create and call the method to display the students details
2. A python program to create student class with a constructor having more
than one parameter
3. A python program to understand instance variable
4. A python program to understand class variable or static variable
5. A python program using a student class with instance method to process
the data of several students
6. A python program to store Data into instance method to process the data
of several students
7. A python program to create a static method that counts the numbers of
instance created for a class
8. A python program to create a static method that calculates the square
root value of a given number
9. A python program that to create bank class where deposits and
withdrawals can be handled using instance method.
10.A python program to access base class constructor from sub class
11.A python program to override super class constructor and method in sub
class
12.A python program to call super class constructor in the sub class using
super()
13.A python program showing single inheritance in which two sub classes are
derived from a single base class
14.A python program to implement multiple inheritance using two base
classes
15.A python program to override the super class method in sub class

16. Create a base class Student(Roll No, Name) which derives two
classes Test (Mark1, Mark2) and Sport(Score). Result(total marks, grade)
class inherits both Test and Sport classes. Write a Python program to
Calculate total of marks and grade.
17. Design two base classes Personal (Name, Address, Email-id,
Birthdate) and Academic (Percentage_in_tenth, Percentage_in_HSC).
Derive a class Biodata from both these classes. Write a Python program to
prepare a biodata of a student having Personal and Academic information.

18. Design a base class customer(name, phone_no). Derive a class


depositor(acc_no, balance) from customer. Again derive a class
borrower(loan_no, loan_amt) from depositor. Write necessary member
functions to read and display the details of a customer.

19. Write a Python program to design a base class person (name,


address, phoneno). Derive a class employee (eno, ename) from person.
Derive a class principal (degree, specialization, salary) from employee.

Write a menu to :

i. accept all details of ‘n’ principals


ii. display details of the principal who is getting higher salary

20. Write a Python program to pass values to base class constructors in


Hierarchical inheritance. Assume suitable classes to exhibit proper
relationships.

21. Write a Python program to pass values to base class constructors in


Multilevel inheritance. Assume suitable classes to exhibit proper
relationships.

You might also like