Missing 1 Required Positional Argument - Issue

TypeError: missing 1 required positional argument in call to super.__init__()

Your call to the __init__ of the superclass isn't correct. You need to pass in the radius and height parameters explicitly, rather than passing in the name of the superclass.

super().__init__(Circle)

should be

super().__init__(radius, height)

__init__() missing 1 required positional argument: 'city'

The problem is with the child class, PrivateAd, constructor. In this class you should call __init__ on the parnet class just once:

# ...
class PrivateAd(News):
def __init__(self, content, city, days):
News.__init__(self, content=content, city=city)
self.days = days
# rest of the code
# ...

By editing this part, you won't have any problem with running your script.



Related Topics



Leave a reply



Submit