Python Object-Oriented Python Instant Objects Master Class

2nd Task Challenge [Solved]

Hey, what I'm doing wrong here?

racecar.py
class RaceCar:

    def __init__(self, color, fuel_remaining, laps = 0, **kwargs):
        self.color = color
        self.fuel_remaining = fuel_remaining
        self.laps = laps

        for key, value in kwargs.items():
            setattr(self, key, value)

    def run_lap(self, length):
        self.fuel_remaining = self.fuel_remaining - (length * 0.125)
        self.run_lap = run_lap + 1

Nevermind, found it myself.

I just tried to add 1 to my method "run_lap" which obviously doesn't work.

However here is the working code:

class RaceCar:

    def __init__(self, color, fuel_remaining, laps = 0, **kwargs):
        self.color = color
        self.fuel_remaining = fuel_remaining
        self.laps = laps

        for key, value in kwargs.items():
            setattr(self, key, value)

    def run_lap(self, length):
        self.fuel_remaining = self.fuel_remaining - (length * 0.125)
        self.laps = self.laps + 1