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 Advanced Objects Dream Car

Lisandro Ancewicz
Lisandro Ancewicz
3,270 Points

Can't figure out what' wrong with this exercise

I build this method def str(self): retrun "My Dream Car is {} {}".format(self.make, self.model) What would be wrong

dream_car.py
class DreamCar:
    def __init__(self, make, model):
        self.make = make
        self.model = model

    def __str__(self):
        retrun "My Dream Car is {} {}".format(self.make, self.model)

1 Answer

Brandon White
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Brandon White
Full Stack JavaScript Techdegree Graduate 35,771 Points

Hi Lisandro,

There are a few issues with your code that are causing you to not pass the challenge, but they're all minor errors with syntax/spelling.

  1. You've spelled return wrong.
  2. Your string is missing a period at the end.
  3. The first letters in Dream and Car are capitalized, but the string you're asked to return does not have the words dream and car capitalized.
  4. You're missing an a after is, in your string.

Fix those tiny things, and you should pass this challenge.

Good luck. :)