Given:
class Vehicle: def __init__(self, name, mileage, capacity): self.name = name self.mileage = mileage self.capacity = capacity class Bus(Vehicle): pass School_bus = Bus("School Volvo", 12, 50)
Hint:
Use isinstance() function
Solution:
class Vehicle: def __init__(self, name, mileage, capacity): self.name = name self.mileage = mileage self.capacity = capacity class Bus(Vehicle): pass School_bus = Bus("School Volvo", 12, 50) # Python's built-in isinstance() function print(isinstance(School_bus, Vehicle))
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Hint:
Use isinstance() function
Solution:
need an explanation for this answer? contact us directly to get an explanation for this answer