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 trialJustin Walters
PHP Development Techdegree Student 18,894 PointsMasterClass Solution
I have no idea why this answer isn't accepted. I opened it in my IDE and I don't see any errors. Suggestions?
class RaceCar:
def __init__(self, color, fuel_remaining, **kwargs):
self.color = color
self.fuel_remaining = fuel_remaining
self.laps = 0
for key, value in kwargs.items():
setattr(self, key, value)
def run_lap(self, length):
self.fuel_remaining -= length * .125
self.laps += 1
4 Answers
Steven Parker
231,269 PointsYour code looks fine to me, good job! Then I copy/pasted it directly into the challenge and it passed!
So .. just try again?
Steven Parker
231,269 PointsMaybe after a browser reset? Machine reboot?
Chels .
4,720 PointsMy code also looked exactly like yours and I also couldn't get it to pass - I had to restart the challenge and copy/paste my own code 4 times before it randomly passed! I've noticed this issue with a few of the code challenges - it's frustrating and confusing, not sure how to get around it
Virginia Mueller
8,518 PointsSame as Chels. My code was identical to this one and it wouldn't take mine but when I copy and pasted it worked. I even put them side by side to make sure I didn't have any typos. Thanks for the help, everyone! I thought I was going crazy.
Steven Parker
231,269 PointsJust curious, do you happen to have a Mac?
Virginia Mueller
8,518 PointsSteven Parker I donβt, I was on my chrome book.
Steven Parker
231,269 PointsIt will be interesting if other folks who experience this problem are using the same.
Daniel Murray
3,294 PointsSame problem here, I spent ages on this
Paul Walker
3,370 PointsPaul Walker
3,370 PointsMy code looked the exact same as yours and I was having the same issue. I opted to copy/paste yours and it seemed to work. Literally the only difference I noticed between mine and yours was that I had an extra space between the class name and the first method.
I am confused.