题解 | #梦想的大学#

梦想的大学

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

相关推荐

11-04 14:10
东南大学 Java
_可乐多加冰_:去市公司包卖卡的
点赞 评论 收藏
分享
11-09 11:01
济南大学 Java
Java抽象带篮子:外卖项目真得美化一下,可以看看我的详细的外卖话术帖子
点赞 评论 收藏
分享
评论
点赞
收藏
分享
牛客网
牛客企业服务