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
How to Open Different Urls At the Same Time by Using Python Selenium
Dividing Each Row by the Previous One
Sqlalchemy: How to Filter Date Field
How to Insert a Checkbox in a Django Form
Filtering Dataframe Using the Length of a Column
Sort Array and Return Original Indexes of Sorted Array
Comparing Digits in an Integer in Python
How to Find the Most Common Element in the List of List in Python
Exclude First Row When Importing Data from Excel into Python
Using a Global Variable With a Thread
Looping in Python: Modify One Column Based on Values in Other Columns
Format/Suppress Scientific Notation from Pandas Aggregation Results
Matplotlib Rotate Image File by X Degrees
Pandas Fill in Missing Date Within Each Group With Information in the Previous Row
Python - How to Fix "Valueerror: Not Enough Values to Unpack (Expected 2, Got 1)"