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 trialAdam Rubinson
4,286 PointsMaster 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.
Adam Rubinson
4,286 Pointsclass 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)
nakalkucing
12,964 PointsHey, are you still having trouble with this? If so, could you please include your whole code? Thanks. :)
5 Answers
Oszkár Fehér
Treehouse Project ReviewerHi 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
Adam Rubinson
4,286 PointsThanks, can't believe I missed this!
Oszkár Fehér
Treehouse Project ReviewerInteresting, i tried to but it's not working. i think it's something wrong in there end. write to support.
Adam Rubinson
4,286 PointsHi can someone please help me with this? I really want to continue with this course asap. The error still exists
Oszkár Fehér
Treehouse Project ReviewerThe functions are inside the class because like this i can't figure out?Here there is just 2 functions with a class title
Temi Folorunsho
2,849 PointsI 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
Oszkár Fehér
Treehouse Project ReviewerOszkár Fehér
Treehouse Project ReviewerHi Adam Please can you upload your code