11. Building Useful Classes


Hi all,

I have tried some of the possible solutions mentioned in the help threads, but nothing seems to work.

The error message is as follows:
Oops, try again. Make sure you define your own repr() for the Point3D class.

Please look at the code below:

class Point3D(object):
    def __init__(self,x,y,z):

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

print my_point

Thanks in advance

11/11 building useful classes

Never mind all.

Found the mistake : It should be repr and not rep


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