【发布时间】:2018-09-19 20:26:34
【问题描述】:
我正在尝试在类中使用嵌套函数。这是我的代码
class big():
def __init__(self):
self.mas = "hello"
def update(self):
def output(self):
print(self.mas)
self.output()
thing = big()
thing.update()
但是,当它运行时,我收到未定义输出的错误。如何在更新函数中运行输出函数?
【问题讨论】:
标签: python-3.x function class nested