11 Building useful classes


The error message I get is:

Oops, try again. It looks like you didn't print "(1, 2, 3)".

I think that my code is correct. Is there something I am not getting?

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


the string printed should an exact match, you miss a few spaces


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.