Python convert pairs list to dictionary

前端 未结 4 1910
执念已碎
执念已碎 2020-12-06 09:04

I have a list of about 50 strings with an integer representing how frequently they occur in a text document. I have already formatted it like shown below, and am trying to c

4条回答
  •  天涯浪人
    2020-12-06 10:03

    Make a pair of 2 lists and convert them to dict()

    list_1 = [1,2,3,4,5]
    list_2 = [6,7,8,9,10]
    your_dict = dict(zip(list_1, list_2))
    

提交回复
热议问题