-1
有按以下格式Python列表分成字典
mylist = [u'Name:', u'John', , u'Doe', u'Address:', u'Washington Street ', u'Chicago']
Python列表有':'
就在鍵結束,在這種情況下Name
和Address
。 新字典應該是這樣的:
newdict = {
'Name': '["John", "Doe"]',
'Address': '["Washington Street", "Chicago"]',
}
這個作品! – bobsr