题解 | #遍历字典#

遍历字典

https://www.nowcoder.com/practice/0315639767824323a2cdb9ee3f998314

operator_dict = {'<':'less than','==':'equal'}
print('Here is the original dict:')
for i in sorted(operator_dict):
    print(f'Operator {i} means {operator_dict[i]}.')

operator_dict['>']='greater than'
print(f'\nThe dict was changed to:')
for j in sorted(operator_dict):
    print(f'Operator {j} means {operator_dict[j]}.')

#python刷题#
Python刷题 文章被收录于专栏

Python刷题记录

全部评论

相关推荐

不愿透露姓名的神秘牛友
07-11 11:22
怎么这么多逆天求职者,救救我救救我救救我😭
flmz_Kk:哈哈哈哈哈哈,这么多求职者,肯定有那一两个逆天的
点赞 评论 收藏
分享
05-27 14:57
西北大学 golang
强大的社畜在走神:27届真不用急,可以搞点项目、竞赛再沉淀沉淀,我大二的时候还在天天打游戏呢
投递华为等公司10个岗位
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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