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 Design

Master Class Q1 ??

I completed Q1 of Master Class challenge set the other day.

Now when I answer Q1 the same as before, it comes up with an error:

"Bummer! Couldn't find the RaceCar class".

Help much appreciated.

Hi Adam Please can you upload your code

class RaceCar:

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

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

Hey, are you still having trouble with this? If so, could you please include your whole code? Thanks. :)

5 Answers

Hi Adam, So I checked your code, the problem is the indentetion

class RaceCar:
    def __init__(self, color, fuel_remaining, **kwargs):
        self.color = color
        self.fuel_remaining = fuel_remaining

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

In your code the for loop it is in the same column as the function, it should be inside the init function, like above. If you still have issues please let me know. I hope this will help you. Happy coding

Thanks, can't believe I missed this!

Interesting, i tried to but it's not working. i think it's something wrong in there end. write to support.

Hi can someone please help me with this? I really want to continue with this course asap. The error still exists

The functions are inside the class because like this i can't figure out?Here there is just 2 functions with a class title

I had the same problem but, when i compared with @Oszkhar Feher i saw that there is a space between the def and init. I hope this helps