不知道为什么
b ={'1': 4, '2': 5, '3': 8, '4': 5, '5': 1, '0': 2} t = sorted(b, key=lambda x: x[1], reverse=True) print(t)当索引值为小于10的数时,就会报错: IndexError: string index out of range
不知道为什么
b ={'1': 4, '2': 5, '3': 8, '4': 5, '5': 1, '0': 2} t = sorted(b, key=lambda x: x[1], reverse=True) print(t)当索引值为小于10的数时,就会报错: IndexError: string index out of range