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

Am I missing something? On the 2nd task . . .

I can not figure out if I am missing something with this second task or if it is a browser issue again. It feels like the code is what it should be - but I can't be sure.

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 * 0.125
        self.laps += 1

1 Answer

Eric M
Eric M
11,545 Points

This code passes for me mate, probably a browser thing. Try using another, hitting the reset button, or logging off then restarting the browser, then logging on again.

It only seems to be a problem with the Python challenges and apparently they're aware and going to rework them.

I should say it's not all of them by the way. I did three of the Python tracks in the last month and it only happened a handful of times total.

Yes, I was finally able to get this code to pass by closing out the browser, relaunching and retyping the solution. It's disappointing that this is happening. It is sending students looking for typos and syntax errors that are not there. A big time waster.

I know that it is not happening all the time. I did some other code challenges earlier in the lesson without issue - and then I was hung up on this one task 1 ( and task 2 ) for close to an hour. I even tried closing the browser - but I did not log out first, and then when I relaunched - I had the same problem.

Oh, well, atleast I am getting familiar with the workarounds.