本文主要是介绍7-10 梦想的度假胜地,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
编写一个程序,调查用户梦想的度假胜地。使用类似于“If you could visit one placein the world, where would you go?”的提示,并编写一个打印调查 结果的代码块。
places = {}
active = True
while active:name = input("\nPlease input your name:")place = input('If you could visit one place in the world, where would you go?')places[name] = placerepeat = input("If there are any people to answer this problem?(yes/no)")if repeat == 'no':active = False
print("\n")
for name, place in places.items():print(name.title()+" would like to go to "+place)
这篇关于7-10 梦想的度假胜地的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!