当前位置:主页 > 软件编程 > Python代码 >
时间:2021-02-05 09:31:29 | 栏目:Python代码 | 点击:次
如下所示:
class A(): def test_a(self): self.m ="hello" def test_b(self): self.test_a() n=self.m + "world" print(n) if __name__ == '__main__': A().test_b()
运行结果: