class Strength(State):
def run(self, gamedata):
print("You have 100 points to assign to your character.\n Start now to assign those Points to your characters strength, agility, speed and defense.")
strenghtwert = int(input("STRENGTH: >>"))
return AGILITY, gamedata, strenghtwert
def next(self, next_state):
if next_state == AGILITY:
return CreatePlayer.agility
class Agility(State):
def run(self, gamedata,strenghtwert):
agilitywert = int(input("AGILITY: >>"))
return SPEED, gamedata, strenghtwert, agilitywert
def next(self, next_state):
if next_state == SPEED:
return CreatePlayer.speed
當我執行此操作時,出現錯誤:ValueError: too many values to unpack (expected 2)
。 我認爲錯誤在return AGILITY, gamedata, strenghtwert
的run()
類Strength
。ValueError:需要解壓縮的值太多(預計爲2)PYTHON
任何想法是什麼問題?
最後一行成功執行的代碼是strenghtwert = int(input("STRENGTH: >>"))
。
我們展示的堆棧跟蹤 – acushner
向我們展示你是如何調用該函數。 – Antimony