11/11 Argument Error?


#1

Hello guys. I get an error every time I try to complete this exercise. Please view my code below.

def Point3D(object):
    def __init__(self, x, y, z):
        self.x = x
        self.y = y
        self.z = z
        
    def __repr__(self):
        return "(%d, %d, %d)" % (self.x, self.y, self.z)
    
my_point = Point3D(1,2,3)
print my_point

I get the following error with this code:

Traceback (most recent call last):
  File "python", line 10, in <module>
TypeError: Point3D() takes exactly 1 argument (3 given)

Uhm, last time I checked my init() initializes exactly three arguments: x, y and z. Is this a bug?


#2

Doh! Never mind. I used def Point3D instead of class Point3D... :relieved: