responses ={}
active_status =Truewhile active_status:
name =input("\nplease input your name:")
response =input("which mountain would you like?")
responses[name]= response
repeat =input("yes or no :")if repeat =='no':
active_status =Falsefor name,response in responses.items():print(name,response)# please input your name:libing# which mountain would you like?taishan# yes or no :yes# please input your name:zhoujielun# which mountain would you like?huashan# yes or no :yes# please input your name:lixiaolong# which mountain would you like?wudangshan# yes or no :no# libinglin taishan# zhoujielun huashan# lixiaolong wudangshan
7.9 熟食店
sandwich_orders =['beef','cheese','fish']
finished_sandwiches =[]while sandwich_orders:
sandwich = sandwich_orders.pop()print('i made your '+sandwich+' sandwich')
finished_sandwiches.append(sandwich)for a in finished_sandwiches:print(a)# i made your fish sandwich# i made your cheese sandwich# i made your beef sandwich# fish# cheese# beef