The console prints out the desired output, but I still get an error message


#1

https://www.codecademy.com/courses/python-intermediate-en-egNXj/1/5?curriculum_id=4f89dab3d788890003000096

This is what the console prints out:
(1,2,3)
None

The error message:
Oops, try again. It looks like you didn’t print “(1, 2, 3)”.

I’m not sure what’s wrong with my code, any help would be appreciated, thanks! :slight_smile:

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


#2

Sorry, nevermind.
It was a spacing issue.
return “(%d, %d, %d)”%(self.x,self.y,self.z)
worked instead of
return “(%d,%d,%d)” % (self.x,self.y,self.z)


#3

the print needs to be an exact match, you miss a few spaces


#4

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