我正在尝试制作一个允许我打印介绍的游戏,您将在下面的代码中看到该介绍,然后如果用户键入“菜单”,则会弹出一个菜单,因此它将显示一个列表。
这就是我的代码的样子:
def displayIntro():
    print('Hello There What Would You Like Type Menu For The Food Menu')
    print()
    menu = input()
    menu = ['Chips']
    if menu: menu.append('burger')
    else: print("Incorrect Command Try Again")
displayIntro()
但是当我运行时它只是空白......
如果我这样做:
def displayIntro():
    print('Hello There What Would You Like Type Menu For The Food Menu')
    print()
    #menu = input()
    #menu = ['Chips']
    #if menu: menu.append('burger')
    #else: print("Incorrect Command Try Again")
displayIntro()
它完美地运行了介绍:/