python 字典 按key值大小 倒序取值的实例

如下所示:

viedoUrl_dict = {1:'hello',2:'python',3:'nihao'}
bit_list = sorted(viedoUrl_dict.keys())
bit_list.reverse()
for key in bit_list:
 m3u8_url = viedoUrl_dict[key]
 print(m3u8_url)

相关推荐