0

I'm trying to create an object using this class but I keep encountering an error

class Point:
     def __init__(self, x=0, y=0):
          self.x = int(x)
          self.y = int(y) ```
class Place(Point):
     def __init__(self, x, y, num, name, price):
          Point.__init__(x, y)
          self.num = str(num)
          self.name = str(name)
          self.price = float(price)

x = Place(1, 2, 1, "AM", 120)

error:

Traceback (most recent call last):
 File "--", line 85, in <module>
   x = Place(1, 2, 1, "AM", 120)
 File "--", line 20, in __init__
   Point.__init__(x, y)
 File "--", line 8, in __init__
   self.x = int(x)
AttributeError: 'int' object has no attribute 'x'

I'm a beginner in Python so I'd really appreciate it if someone can help. Thanks!

0 Answers0