About this document
Python Programming Journal for MCA-1 by Ashik Ali is a document available to read on EtoBox.
Program 1 creates a class called Dog with attributes like name and age. It defines methods like bark() and eat(). An object is created and the methods are called. Program 2 creates a parent class called Animal and subclasses Dog and Cat. The subclasses inherit attributes and methods from the parent class. Polymorphism is shown as the eat() method is overridden in the subclasses. Program 3 demonstrates inheritance by creating classes for shapes like Circle, Rectangle etc that inherit from a parent Shape c
- Author
- Ashik Ali
- Language
- EN