Leetcode刷题--知识点查漏补缺

Posted -Ruirui-

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Leetcode刷题--知识点查漏补缺相关的知识,希望对你有一定的参考价值。

python3-列表-字典

1.列表1作为key,列表2作为value,组成一个字典

 1 #定义两个列表
 2 list1 = ["a","b","c"]
 3 list2 = ["","绿",""]
 4      
 5 #合并为字典,调用dict(zip())
 6 dict_name = dict(zip(list1,list2))
 7 
 8 print(dict_name)
 9 
10 运行结果:
11 {"a": "", "b": "绿","c": "" }???????

 



以上是关于Leetcode刷题--知识点查漏补缺的主要内容,如果未能解决你的问题,请参考以下文章