DS301222 #Create a Bus class that inherits from the Vehicle class. Give the capacity argument of Bus.seating_capacity() a default value of 50

class Vehicle:
def init(self, name, max_speed, mileage):
self.name = name
self.max_speed = max_speed
self.mileage = mileage

def seating_capacity(self, capacity):
    return f"The seating capacity of a {self.name} is {capacity} passengers"

class Bus(Vehicle):

def seating_capacity(self, capacity=50):
    return super().seating_capacity(capacity=50)

School_bus = Bus(“Marco Polo”, 150, 12)
print(School_bus.seating_capacity())

2 Likes

Keep Practicing @vaishu.swap10112016

1 Like