eng2sp = dict()
eng2sp
#打印结果:{}
eng2sp = dict()
eng2sp['one'] = 'uno'
eng2sp
#打印结果:{'one': 'uno'}
#字典的元素不使用整数索引来索引,而是用键来查找对应的值:
eng2sp = {'one': 'uno', 'two': 'dos', 'three': 'tres'}
eng2sp
eng2sp['two']
#打印结果:'dos'
字典的基础表达方法
最新推荐文章于 2023-01-01 20:59:03 发布