我的代码说我的变量(名称)未定义。我正在制作一个故事游戏。我希望它稍后打印名称,但它说该变量未定义。当我在 replit 中将鼠标悬停在它上面时,它所说的一切都是一样的
未定义的名称“名称” pyflakes
Pyflakes 在错误信息下。另外,当我运行它时,错误是
定义是:
print("What is your name? [Fantasy names supported!]")
name = input("")
我知道这是低效的。我的朋友写了那部分。
印刷:
print("You wake- 'OMIGOD "+ (name) + "YOU'RE ALIVE!!' Jamie yells. 'yes..?....???' 'YES!' But- where are... they??? You look around. You make an attempt at walking, but stumble to the ground.")