题解 | #梦想的大学#

梦想的大学

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!")
    
全部评论

相关推荐

点赞 评论 收藏
分享
09-09 16:12
已编辑
西南石油大学 Java
future0210:学java就是好啊,啥都能转
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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