编写一个循环,提示用户输入一系列的比萨配料,并在用户输入'quit' 时结束循环。每当用户输入一种配料后,都打印一条消息,说我们会在比萨 中添加这种配料。
prompt = "\nPlease input the needs of pizza:"
prompt += "\nEnter 'quit' to end the program"
while True:
need = input(prompt)
if need == 'quit':
break
print("adding "+need)

本文介绍了一个简单的Python程序,用户可以输入比萨配料,直到输入'quit'退出。程序会实时打印出添加配料的消息。
4132

被折叠的 条评论
为什么被折叠?



