Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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

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
.a{fill-rule:evenodd;}techdegree seal-36
Brandon White
Treehouse Moderator

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. :)