题解 | #遍历字典#

遍历字典

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

import sys

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

d['>'] = 'greater than'
print()
print('The dict was changed to:')
for i in sorted(d.keys()):
    print('Operator {} means {}.'.format(i, d[i]))

全部评论

相关推荐

已老实求offer😫:有点像徐坤(没有冒犯的意思哈)
点赞 评论 收藏
分享
害怕一个人的小黄鸭胖乎乎:笑死了,没有技术大牛,招一堆应届生,不到半年,代码就成屎山了
点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务