我正在使用python和一个名为Replit的IDE。 cont1在调用之前已定义
if roomchoose=="2":
sleep(1)
print("You open the door on the right, only to find a run down kitchen.")
sleep(1)
print("You try the door on the left, and find a small bedroom, the sword and shield lay neatly on the bed")
cont1()
在cont1()上,它告诉我它没有定义,但是,我已经定义了它(在上面调用它)
def cont1():
inventory.append("Sword. Shield")
sleep(1)
print("Sword (3dmg) added to inventory. Shield (3 defense) added to inventory")
sleep(1)
这就是它被定义的地方,我做的和另一个函数完全一样,它似乎在工作。所以,我不确定是IDE让人讨厌,还是这个特定函数有错误
目前没有回答
相关问题 更多 >
编程相关推荐