题解 | #梦想的大学#

梦想的大学

http://www.nowcoder.com/practice/f0de95ee47c844e78d70a21f7b2c7911

survey_dict = {}

while True:
    print('If you have the chance, which university do you want to go to most?')
    print('What is your name?')
    name = input()
    print('Which university do you want to go to most?')
    university = input()
    
    #将键值对存入字典
    survey_dict[name] = university
  

    print("Is there anyone who hasn't been investigated yet?")
    #判断是否结束循环
    if input() == 'No':
        break

for i in sorted(survey_dict):
    print(f"I'am {i}. I'd like to go to {survey_dict[i]} if I have the chance!")
    
全部评论

相关推荐

05-20 13:59
门头沟学院 Java
米黑子米黑子:你这个成绩不争取下保研?
点赞 评论 收藏
分享
不愿透露姓名的神秘牛友
昨天 12:10
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务