我需要帮助调试

时间:2017-06-07 11:26:37

标签: python-2.7

# 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)

1 个答案:

答案 0 :(得分:0)

基于我得到的例外情况, 如果您使用的是python 2,请使用raw_input('> ') 如果您使用的是python3,请使用str(input('> '))