您的位置:首页 > 编程语言 > Python开发

python课后习题 7-10

2019-03-24 15:48 169 查看

7-10 梦想的度假胜地:
编写一个程序,调查用户梦想的度假胜地。使用类似于“If you could visit one place in the world, where would you go?”的提示,并编写一个打印调查结果的代码块。

info={}
active=True

while active:
name=input("Hi, what's your name? ")
place=input("If you could visit one place in the world, where would you go? ")

info[name]=place
repeat=input("anyone else?(yes/no) ")
if repeat=='no':
active=False
print("\n------ poll result ------\n")
for name,place in info.items():
print(name+ " would visit "+ place)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: