I got the tick from the website , however my output is not what i expect it to be, it gives me this output:
new None used <bound method ElectricCar.display_car of <ElectricCar object at 0x7fe7d05890d0>>
I have included my code below, I have tried debugging but apparently I’m just stuck. I hope you guys can help me out!
class Car(object): condition = "new" def __init__(self, model, color, mpg): self.model = model self.color = color self.mpg = mpg def display_car(self): return "This is a %s %s with %s MPG." % (self.color, self.model, self.mpg) def drive_car(self): self.condition = "used" my_car = Car("DeLorean", "silver", 88) print my_car.condition print my_car.drive_car() print my_car.condition class ElectricCar(Car): def __init__(self , model, color , mpg , battery_type): self.battery_type = battery_type self.model = model self.color = color self.mpg = mpg my_car = ElectricCar("Honda" , "Red" , 88, "molten salt") print my_car.display_car