# make a list
shopping_list = []
# print instructions how to use app
print("what should we pick up at store")
print("Enter 'DONE' to stop adding items")
while True:
# ask for new items
new_item = input("> ")
# quit app
if new_item == "DONE":
break
# add new items to list
shopping_list.append(new_item)
# print out app
print("Here's your list:")
for item in shopping_list:
print(item)
答案 0 :(得分:0)
基于我得到的例外情况,
如果您使用的是python 2,请使用raw_input('> ')
如果您使用的是python3,请使用str(input('> '))