题解 | #遍历字典#
遍历字典
https://www.nowcoder.com/practice/0315639767824323a2cdb9ee3f998314
operators_dict={'<':'less than','==': 'equal'}
print('Here is the original dict:')
for key in operators_dict:
print(f'Operator {key} means { operators_dict[key]}.')
print()
operators_dict['>']='greater than'
print('The dict was changed to:')
for key in operators_dict:
print(f'Operator {key} means { operators_dict[key]}.')
查看15道真题和解析
