This repository contains two Python assignments demonstrating object-oriented programming concepts such as inheritance, polymorphism, and encapsulation, themed around "the boys."
- Defines a
Boy
class with attributes and methods. - Defines a
SingingBoy
subclass that inherits fromBoy
and overrides a method to demonstrate polymorphism. - Demonstrates constructors to initialize objects with unique values.
- Defines a base
Boy
class with private attributes (encapsulation). - Defines
SingingBoy
andDancingBoy
subclasses that inherit fromBoy
. - Each subclass overrides the
action()
method to demonstrate polymorphism. - Includes getter methods to access private attributes.
Run them using Python 3:
python assignment1.py
python assignment2.py
Each script will print output demonstrating the respective OOP concepts.
Created as a demonstration of OOP principles with a "boys" theme.