问题遇到的现象和发生背景
用代码块功能插入代码,请勿粘贴截图
class parent():
def p(self):
print("正在调用父类的方法")
class child(parent):
def c(self):
print("正在调用子类的方法")
p1=child()
p1.p()
运行结果及报错内容
1
1
1
1
1
1
1
1
1
class parent():
def p(self):
print("正在调用父类的方法")
class child(parent):
def c(self):
print("正在调用子类的方法")
p1=child()
p1.p()
1
1
1
1
1
1
1
1
1
你的ide的问题吧,你排除一下,你是不是没有运行这份代码,我这边测试是正常的,