11. Construir clases útiles


#1



https://www.codecademy.com/es/courses/python-intermediate-en-xef6m/1/5?curriculum_id=53a32847fed2a88075000001#


class Punto3D(object):
        def __init__(self, x, y, z):
            self.x = x
            self.y = y
            self.z = z
        def __repr__(self):
            return("(%d,%d,%d)" % (str(self).x, str(self.y), str(self.z))

miPunto = Punto3D(1,2,3)
print miPunto

----------
Error message:
File "python", line 9
    miPunto = Punto3D(1,2,3)
          ^
SyntaxError: invalid syntax

----------
Thanks!


#2

HI this line

return("(%d,%d,%d)" % (str(self).x, str(self.y), str(self.z))

should be like the instruction says..
Definií un método repr() que devuelva "(%d, %d, %d)" % (self.x, self.y, self.z). ...

return "(%d, %d, %d)" % (self.x, self.y, self.z)

you don't need to use the str()