文件名称:python练习dict2list
文件大小:1KB
文件格式:PY
更新时间:2015-09-16 15:19:33
python dic list
练习将python中将字典dic转化为列表list,如: dic = { "a1":{ "b1":["c1"] }, "a2":{ "b2":["c2", "c3"], "b3":["c4", "c5"] }, "a3":"b4", "a4":{ "b5":{ "c6":{"d1":0} } } } 转化为: list = [ ['a1', 'b1', 'c1'], ['a3', 'b4'], ['a2', 'b2', 'c2'], ['a2', 'b2', 'c3'], ['a2', 'b3', 'c4'], ['a2', 'b3', 'c5'], ['a4', 'b5', 'c6', 'd1', 0] ]