-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」関数の2行目に問題があり、何が間違っているのかわかりません。どんな助けでも大歓迎です。Pythonのスコープとオブジェクトに関する問題
「問題がある」とはどういう意味ですか?何が問題なのですか? – BrenBarn
エラーとは何ですか?あなたのコードを試しましたが、問題はありませんでした。 – eyllanesc