Welcome to the Treehouse Community
Looking to learn something new?
William Heilman1,764 Points
Some attributes didn’t get set correctly
I’m not sure why this isn’t passing...it works fine in console
class RaceCar: def __init__(self, color, fuel_remaining, **kwargs): self.color = "Blue" self.fuel_remaining = "100" for key, value in kwargs.items(): setattr(self, key, value)
You aren't actually setting the
fuel_remaining properties equal to the arguments that are passed to the method. You are instead hardcoding them to "Blue" and "100", which is not what the task asked for.
If you set them equal to the passed in arguments like this:
class RaceCar: def __init__(self, color, fuel_remaining, **kwargs): self.color = color # Set self.color to passed in argument self.fuel_remaining = fuel_remaining # Set fuel_remaining to passed in argument for key, value in kwargs.items(): setattr(self, key, value)
Then your code will pass the first task.