OOP Python Program Example (1)
OOP Python Program Example (1)
Object-Oriented Programming (OOP) in Python allows developers to structure code using objects
and classes. Here's an example of a simple OOP-based program using and not using the special
method __init__.
self.brand = brand
self.model = model
def display_info(self):
self.brand = brand
self.model = model
def display_info(self):
bike1 = Bike()
bike1.set_info("Honda", "CBR")
Cons: