Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialAlex Salas
3,429 PointsRaceCar class run_lap
What am I missing here? I am getting Bummer! Try again!
It must be something small. Cant find typos.
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 -= (lenght * .125)
self.laps += 1
1 Answer
Robert Stefanic
35,170 PointsThere's a typo in your run_lap function. There's a misspelling of length in the function. You have it spelt lenght.
Try fixing it and let me know if you still get the error.
Alex Salas
3,429 PointsAlex Salas
3,429 PointsThat was it. Thanks Robert !
Robert Stefanic
35,170 PointsRobert Stefanic
35,170 PointsYou're welcome.