May-21-2020, 04:30 PM
im lerning classs and i have this error

def increment_odometer(self,miles): self.odometer_reading += miles class Battery: """A simple attempt to model a battery for an electric car""" def __init__(self,battery_size=75): """intialize the battery's attributes.""" self.battery_size = battery_size def describe_battery(self): """print a statemennt describing the battery size""" print(f"this car has a {self.battery_size}-kWh battery.") class ElectricCar(Car): """represent aspects of a car ,specific to electric vehicles""" def __init__(self, make, model, year): """ Initialize attributes of the parent class. then initialize attributes specific to an electric car. """ super().__init__(make, model, year) self.battery = Battery() def fill_gas_tank(self): """Electric cars dont have gas tanks.""" print("this car dosen't need a gas tank!") my_tesla = ElectricCar('tesla','model s' , 2019) print(my_tesla.get_descriptive_name()) my_tesla.battery.describe_battery()
Error: File "C:\Users\alex8\Documents\python\python _work.py\chpter 9\electric_car.py", line 44
super().__init__(make, model, year)
^
IndentationError: unindent does not match any outer indentation level