Building useful classes


Hello good fellas I am getting an error her and i tried str() but it can't accept more than 1 variable what's the catch?

class 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)

print my_point

Where is the catch


the output should be:

(1, 2, 3)

your output:


see the differences? spaces vs no spaces


Well LOL :smiley:

Thank you Master