1. update()方法
1
2
3
a = {'one': 1, 'two': 2, 'three': 3}
a.update({'one':4.5, 'four': 9.3})
print(a)
输出:
{'one': 4.5, 'two': 2, 'three': 3, 'four': 9.3}
1
2
3
a = {'one': 1, 'two': 2, 'three': 3}
a.update({'one':4.5, 'four': 9.3})
print(a)
输出:
{'one': 4.5, 'two': 2, 'three': 3, 'four': 9.3}