11/11 total WTF same code?


#1
#the official solution
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
#prints "(1, 2, 3)"

#my answer
class Point3D(object):
  def __init__(self,x,y,z):
    self.x = x
    self.y = y
    self.z = z
    
  def __rep__(self):
    return "(%d, %d, %d)" % (self.x, self.y, self.z)

my_point = Point3D(1, 2, 3)
print my_point
#prints  "<Point3D object at 0x7f718f15c290>"

I can’t for the life of me find out what the heck is the difference. But this is the part of the code that gets screwy:

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

When I replace this part of the solution code into mine, I get the right print out. When I replace mine, it gets the other thing
(This is mine)

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

An explanation would be awesome. At this moment I feel like codecademy is out to screw with my head.

Thank you!


#2

You need to print out (1, 2, 3) ?

Take a good look at your code, it’s not the same


#3

Ohhhhhhhhhhhhhh It’s the missing r

Ughhh !!! There’s no margin for error in this biz!

Thanks for making me look for myself


#4