#创建一个空字典
empty_dict = dict()
print(empty_dict) #用**kwargs可变参数传入关键字创建字典
a = dict(one=,two=,three=)
print(a) #传入可迭代对象
b = dict(zip(['one','two','three'],[,,]))
print(list(zip(['one','two','three'],[,,])))
print(b) #传入可迭代对象
c = dict([('one', ), ('two', ), ('three', )])
print(c) c1 = dict([('one', ), ('two', ), ('three', ),('three', ),('three', )])
print(c1)#如果键有重复,其值为最后重复项的值。 #传入映射对象,字典创建字典
d = dict({'one': , 'two': , 'three': })
print(d) print(a == b == c == d)
复制代码
输出: {}
{'one': , 'two': , 'three': }
[('one', ), ('two', ), ('three', )]
{'one': , 'two': , 'three': }
{'one': , 'two': , 'three': }
{'one': , 'two': , 'three': }
{'one': , 'two': , 'three': }
True
复制代码

最新文章

  1. Guidance of Set up FTP Server
  2. BZOJ1951[SDOI2010]古代猪文
  3. iOS 收起键盘的几种方式
  4. CSS3媒体查询
  5. Java-->IO流模拟实现用户登录以及登录信息
  6. Linux 命令 - kill: 向进程发送信号
  7. Android模拟器的ip获取以及模拟器之间socket通信
  8. hdoj 2524 矩形A + B【递推】
  9. OC——NSDictionary和NSMutableDictionary
  10. 注解配置的Spring MVC
  11. jQuery插件slides实现无缝轮播图特效
  12. 基于Unity的Profiler性能分析
  13. Cookies的实际存储位置
  14. 电梯调度二——曹玉松&&蔡迎盈
  15. python笔记之time模块
  16. XML之Well-Formed文档规则
  17. Restful framework【第四篇】视图组件
  18. spring websocket集群问题的简单记录
  19. Cells UVALive - 3486(dfs序+手动开栈)
  20. Django框架<一>

热门文章

  1. python 列表总结大全
  2. 【Vue 2.X】基于ElementUI 实现 dialog弹窗移动效果-自定义指令系列(二)
  3. pylint在pycharm的使用及pylint的配置
  4. P.W.N. CTF - MISC - Canadian FOI
  5. BZOJ4710 [Jsoi2011]分特产 容斥
  6. jupyter notebook 几个方法
  7. 分组函数 partition by 的详解,与order by 区别
  8. Linux批量新建文件夹(大括号表达式的应用)
  9. pipelines和重定向命令
  10. 前端必用正则(js)