Python:11.Building useful classes


#1

Hello, Friends I am stuck at https://www.codecademy.com/courses/python-intermediate-en-egNXj/1/5?curriculum_id=4f89dab3d788890003000096#
following is my code

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)

my_point=Point3D(1,2,3)
print my_point

I get following error message

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

Can anybody point my mistake?


#2

the output printed should be an exact match, in you case, some spaces and parentheses are missing (the parentheses are not part of the string)


#3

update**

I mistook while observing it.
do as mentioned by @stetim94


#4

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