将用户输入的项附加到数组中,然后显示它们
好的,我正在尝试创建一个购物清单,它将输入的每个商品追加到一个数组中,直到用户输入"0"
我已经走到这一步了,它就是不起作用:-(
如果您能给我一些建议或建议,我将非常感激!
非常感谢!
选择 | 换行 | 行号
- ShopList = []
- ListItem= ()
- print("To make a shopping list")
- print("Enter the items, when you have finished press 0 to display the list.")
- while ListItem != 0:
- ListItem = input ("Enter your Item to the List: ")
- ShopList.append(ListItem)
- print ("Here's your Shopping List:")
- for item in ShopList:
- print item