python 中 字典和 zip
2020-01-15 11:09
1641 查看
a = {'a':1, 'b':2, 'c':3, 'd':4} b = dict(a=1, b=2, c=3, d=4) c = dict({'a':1, 'b':2, 'c':3, 'd':4}) list1 = ['a', 'b', 'c', 'd'] list2 = [1, 2, 3, 4] d = dict(zip(list1, list2)) print(d) # {'a': 1, 'b': 2, 'c': 3, 'd': 4} print(a == b == c == d) # True
- 点赞
- 收藏
- 分享
- 文章举报
相关文章推荐
- python zip函数同时遍历两个数组和构造字典
- python 中的迭代 for zip 字典
- python zip 生成字典
- Python的zip函数——将两个列表转换成字典
- Python: 字典dict: zip()
- Zip加密文件字典破解Python实现
- python 使用zip反转字典
- Python字典使用(八)
- python中列表、元组、字典的区别
- python基础刻意练习--Task 6 字典与集合
- python中包含UTF-8编码中文的列表或字典的输出
- python3中的map()、reduce()、zip()与zip(*)函数
- Python字典方法总结
- Python_字典基础
- python将字典中的数据保存到文件中
- python 集合&字典_frozenset & defaultdict & MD5在线加密解密工具
- python 3.0 字典 key 排序
- Python用zip函数同时遍历多个迭代器示例详解
- [转]Python中zip()函数用法举例
- python字典模拟登陆