📅  最后修改于: 2022-03-11 14:45:38.413000             🧑  作者: Mango
#This is to convert two lists into a dictionary in Python
#given ListA is key
#given ListB is value
listA = ['itemA','itemB']
listB = ['priceA','priceB']
dict(zip(listA, listB))
# Returns
{'itemA': 'priceA',
'itemB': 'priceB'
}