perent class in python

 perent class in python

class vehicle :

    def __init__(self,mileage,cost):

        self.mileage=mileage

        self.cost=cost

    

    def show_details(self):

        print("i am a vehicle")

        print("mileage of vehicle",self.mileage)

        print("cost of vehicle is",self.cost)

v1 = vehicle(24,2525252)

v1.show_details()

#OUT PUT

i am a vehicle mileage of vehicle 24 cost of vehicle is 2525252



Comments

Post a Comment

Popular posts from this blog

What is chopper

What is Resistor

Top 5 best Ethical hacking book for beginners