-3
class Thing:
def __init__ (self, a, b, c,):
self.a = a
self.b = b
self.c = c
stuff = Thing("apples","butter","charlie")
otherThing = stuff
def doTheThings():
if(otherThing.a == "apples"):
print("done")
doTheThings()
我有一个问题,“doTheThings”功能的第二行,我不知道什么是错的。任何帮助将非常感激。蟒蛇的范围和对象的一些麻烦
你是什么意思“有问题”?究竟是什么问题? – BrenBarn
什么是错误?,我试过你的代码,我没遇到问题。 – eyllanesc