Python OOPS Programs help beginners to get expertise in Object-Oriented Programming (OOP). Python programming paradigm that focuses on creating objects that encapsulate data and behavior. Python is an object-oriented programming language, which means it supports OOP concepts such as inheritance, polymorphism, encapsulation, and abstraction.
Python OOPS Programs for Practice
1). Python oops program to create a class with the constructor.
2). Python oops program to create a class with an instance variable.
3). Python oops program to create a class with Instance methods.
4). Python oops program to create a class with class variables.
5). Python oops program to create a class with a static method.
6). Python oops program to create a class with the class method.
7). Write a Python Class to get the class name and module name.
8) Write a Python Class object under syntax if __name__ == ‘__main__’.
9). Python class with Single Inheritance.
10). Python Class with Multiple Inheritance.
11). Python Class with Multilevel Inheritance.
12). Python Class with Hierarchical Inheritance.
13). Python Class with Method Overloading.
14). Python Class with Method Overriding.
15). Write a Python Class Program with an Abstract method.
16). Write a Python Class program to create a class with data hiding.
17). Python Class Structure for School Management System.
18). Write a Python Class Structure for Employee Management Application.
19). Write a Python Class with @property decorator.
20). Write a Python Class structure with module-level Import.
21). Create 5 different Python Classes and access them via a single class object.
22). Create 5 Python classes and set up multilevel inheritance among all the classes.
23). Set Instance variable data with setattr and getattr methods.
24). Python oops program with encapsulation.
25). Create a Python class called Rectangle with attributes length and width. Include methods to calculate the area and perimeter of the rectangle.
26). Create a Python class called Circle with attributes radius.
Include methods to calculate the area and circumference of the circle.
27). Create a Python class called Person with attributes name and age. Include a method to print the person’s name and age.
28). Create a Python class called Student that inherits from the Person class.
Add attributes student_id and grades. Include a method to print the student’s name, age, and student ID.
29). Create a Python class called Cat that inherits from the Animal class.
Add attributes breed and weight. Include a method to print the cat’s name, color, breed, and weight.
30). Create a Python class called BankAccount with attributes account_number and balance. Include methods to deposit and withdraw money from the account.
31). Create a Python class called SavingsAccount that inherits from the BankAccount class. Add attributes interest_rate and minimum_balance. Include a method to calculate the interest on the account.
32). Create a Python class called CheckingAccount that inherits from the BankAccount class. Add attributes transaction_limit and transaction_fee. Include a method to check if a transaction is within the limit and deduct the fee if necessary.
33). Create a Python class called Car with attributes make, model, and year.
Include a method to print the car’s make, model, and year.
34). Create a Python class called ElectricCar that inherits from the Car class.
Add attributes battery_size and range_per_charge. Include a method to calculate the car’s range.
35). Create a Python class called StudentRecord with attributes name, age, and grades. Include methods to calculate the average grade and print the student’s name, age, and average grade.
36). Create a Python class called Course with attributes name, teacher, and students. Include methods to add and remove students from the course and print the course’s name, teacher, and list of students.
37). Create a Python class called Shape with a method to calculate the area of the shape. Create subclasses called Square and Triangle with methods to calculate their respective areas.
38). Create a Python class called Employee with attributes name and salary.
Include a method to print the employee’s name and salary.
39). Create a Python class called Manager that inherits from the Employee class.
Add attributes department and bonus. Include a method to calculate the manager’s total compensation.
40). Create a Python class called Customer with attributes name and balance.
Include methods to deposit and withdraw money from the customer’s account.
41). Create a Python class called VIPCustomer that inherits from the Customer class. Add attributes credit_limit and discount_rate. Include a method to calculate the customer’s available credit.
42). Create a Python class called Phone with attributes brand, model, and storage. Include methods to make a call, send a text message, and check storage capacity.
43). Create a Python class called Laptop with attributes brand, model, and storage. Include methods to start up the laptop, shut down the laptop, and check storage capacity.
44). Create a Python class called Book with attributes title, author, and pages.
Include methods to get the book’s title, author, and number of pages.
45). Create a Python class called EBook that inherits from the Book class.
Add attributes file_size and format. Include methods to open and close the book.
46). Create a Python class called ShoppingCart with attributes items and total_cost. Include methods to add and remove items from the cart and calculate the total cost.
47). Create a Python class called Animal with attributes name and color.
Include a method to print the animal’s name and color.
48). Create a Python class called Dog that inherits from the Animal class.
Add attributes breed and weight. Include a method to print the dog’s name, color, breed, and weight.