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 trial

Python Object-Oriented Python Instant Objects Master Class

MasterClass 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?

racecar.py
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

My 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.

4 Answers

Steven Parker
Steven Parker
231,269 Points

Your code looks fine to me, good job! :+1: Then I copy/pasted it directly into the challenge and it passed!

So .. just try again?

Steven Parker
Steven Parker
231,269 Points

Maybe after a browser reset? Machine reboot?

Chels .
Chels .
4,720 Points

My 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
Virginia Mueller
8,518 Points

Same 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
Steven Parker
231,269 Points

Just curious, do you happen to have a Mac?

Virginia Mueller
Virginia Mueller
8,518 Points

Steven Parker I don’t, I was on my chrome book.

Steven Parker
Steven Parker
231,269 Points

It will be interesting if other folks who experience this problem are using the same.

Daniel Murray
Daniel Murray
3,294 Points

Same problem here, I spent ages on this