Learn Special Methods by Building a Vector Space - Step 23

Tell us what’s happening:

I dont get it, why i have error: This is my code, i return de tuble a set in string because str only have return a string, Place somebody can to help me:

Your code so far


    def __str__(self):
        return str(tuple(getattr(self, i) for i in vars(self)))

Kindly include a link to this lesson.

Welcome back to the forum @estebanclimb

Start to fix the __str__ method by

  • replacing the string returned by __str__() with a generator expression that iterates through the object attributes and calls getattr() for each attribute i .

I can still see you are using str

Happy coding