列表轉換成字典,需要用2個列表轉化成字典,壹個是key,壹個是value。比如:
>>>dict(zip(['a','b','c'], range(5)))
{'a': 0, 'c': 2, 'b': 1}
>>> a=[1,2,3]
>>> ''.join( [ str(x) for x in a])
'123'
>>> b={1:11, 2:22, 3:33}
>>> ''.join( [ str(x) for x in b.values()])
'112233'
>>> ''.join( [ str(x) for x in b])
'123'
>>> ''.join( [ str(x) for x in b.items()])
'(1, 11)(2, 22)(3, 33)'
>>>