This repository contains solutions for two programming activities focused on classes, inheritance, and polymorphism in Python.
- Created a
Smartphoneclass with attributes like brand, model, storage, and color. - Added methods such as
make_call()andtake_photo()to simulate phone functionality. - Implemented inheritance with a subclass
AndroidPhonethat adds an Android version attribute and aninstall_app()method. - Demonstrated object creation and method usage.
- Defined a base class
Vehiclewith an abstract methodmove(). - Created subclasses
Car,Plane, andBoatthat each implementmove()differently. - Showcased polymorphism by iterating over a list of vehicles and calling their respective
move()methods, producing distinct outputs.
- Clone or download this repository.
- Open the Python files in your favorite editor or IDE.
- Run the scripts to see class behavior and polymorphism in action.