Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

📘 Day 6 – Python Classes & Objects (BMW Cars & Suzuki Bikes)


🔰 Overview

Welcome to Day 6 of your Python learning journey! This lesson was about creating classes and objects to model real-world entities.

You built two separate classes — one for Cars and one for Bikes — and learned how to define attributes, methods, and create multiple instances from the same class.


📂 File Structure

Day6/
└── day6.py    # Python file demonstrating Cars and Bikes classes

Click here to view the Day 6 code


🧠 Concepts Covered

✅ Class Basics

  • Defining a class with attributes and methods.
  • Using the __init__ constructor to initialize object properties.
  • Assigning default class-level attributes.

✅ Creating Objects

  • Instantiating multiple objects from the same class.
  • Passing different parameters to create distinct instances.

✅ Methods

  • Defining custom methods (accelerate, braking, ppf) to represent object behaviors.
  • Calling methods on different instances.

✅ Real-Life Examples

  • Cars Class: Modeled BMW cars with details like name, cost, speed, and fuel economy.
  • Bikes Class: Modeled Suzuki bikes with attributes and a method to represent PPF (Paint Protection Film).

💡 Skills Sharpened

✔️ Creating reusable class blueprints. ✔️ Working with instance and class attributes. ✔️ Simulating real-world entities in code. ✔️ Encapsulating behavior inside methods.


📌 Quick Tips

  • Keep method names lowercase (e.g., brake() instead of Braking()) for consistency.
  • Use descriptive attribute names for clarity.
  • Store repeated values (like brand name) in class attributes to avoid redundancy.

🚀 Keep Going!

With the basics of class creation mastered, you’re ready to move into OOP concepts like inheritance and polymorphism in Day 7.