Vv *_*_su 2 python inheritance
我是编程新手.这是我下面的简单代码
class BaseClass(object):
def __init__(self):
self.value = 10
def add(self):
c = self.value + 10
print("the sum is:")
print(c)
class InheritingClass(BaseClass):
pass
x = InheritingClass(BaseClass)
Run Code Online (Sandbox Code Playgroud)
我正在使用python进行继承.当我运行此脚本时,我收到此错误
Traceback (most recent call last):
File "F:/python/classes_01.py", line 20, in <module>
x = InheritingClass(BaseClass)
TypeError: __init__() takes 1 positional argument but 2 were given
Run Code Online (Sandbox Code Playgroud)
有没有人对此有所了解.
非常感谢你