Question

Consider the following Python code: class Vehicle:     def __init__(self, brand):         self.brand = brand     def display_info(self):         return f"Brand: {self.brand}" class Car(Vehicle):     def __init__(self, brand, model):         super().__init__(brand)         self.model = model     def display_info(self):         return f"{super().display_info()}, Model: {self.model}" my_car = Car("Toyota", "Camry") print(my_car.display_info()) What will be the output of this code?

A Brand: Toyota, Model: Camry
B Brand: Toyota
C Model: Camry
D A `TypeError` because `super().__init__(brand)` is incorrect.
E An `AttributeError` because `brand` is not defined in `Car`.
Practice Next

Hey! Ask a query