Python的字典的items(), keys(), values()都返回一个list
1>>> dict = { 1 : 2, 'a' : 'b', 'hello' : 'world' } 2>>> dict.values() 3['b', 2, 'world'] 4>>> dict.keys() 5['a', 1, 'hello'] 6>>> dict.items() 7[('a', 'b'), (1, 2), ('hello', 'world')] 8>>>
时间:2021-06-11 07:43:48
Python的字典的items(), keys(), values()都返回一个list
1>>> dict = { 1 : 2, 'a' : 'b', 'hello' : 'world' } 2>>> dict.values() 3['b', 2, 'world'] 4>>> dict.keys() 5['a', 1, 'hello'] 6>>> dict.items() 7[('a', 'b'), (1, 2), ('hello', 'world')] 8>>>
Python 之字典(dict)根据 value 获取 key
2020-10-01
python dict 选择第一个 最后一个元素的key或value
2019-04-16
python字典函数values() keys() items()的用法与区别
2022-05-01