Skip to content

Latest commit

Β 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

OOP Assignment

Description

This project demonstrates Object-Oriented Programming (OOP) concepts in Python, focusing on class and polymorphism.

Instructions

Assignment 1: Design Your Own Class! πŸ—οΈ

Create a class representing anything you like (a Smartphone, Book, or even a Superhero!).

Add attributes and methods to bring the class to life!

Use constructors to initialize each object with unique values.

Add an inheritance layer to explore polymorphism or encapsulation.

Activity 2: Polymorphism Challenge! 🎭

Create a program that includes animals or vehicles with the same action (like move()). However, make each class define move() differently (for example, Car.move() prints "Driving" πŸš—, while Plane.move() prints "Flying" ✈️).

Concepts Covered

Classes & Objects – Creating custom data types.

Inheritance – Subclasses (Car, Plane, Boat) inherit from a base class (Vehicle).

Polymorphism – Each subclass defines its own version of the move() method.

Method Overriding – Subclasses replace the parent class's move() method with their own.

Files

pet.py – Demonstrates Designing Your Own Class adding attributing and methods.

animals.py – Demonstrates polymorphism with different types of animals.

README.md – Project description and instructions.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages