method1:
dic = {}
keys= dic.keys()
keys.sort()
for key in keys:
print dic[key]
method2:
for key in sorted(write_list_hash.keys()):
print write_list_hash[key]
|
||||||
python 键值排序输出method1: dic = {} keys= dic.keys() keys.sort() for key in keys: print dic[key]
method2: for key in sorted(write_list_hash.keys()): Leave a Reply |
||||||
Copyright © 2025 小生这厢有礼了(BioFaceBook Personal Blog) - All Rights Reserved Powered by WordPress & Atahualpa |
Recent Comments