d1 = {'one': 1, 'two': 2}
d2 = {'one': 1, 'two': 2}
d3 = {'one': 1, 'two': 2}
print(dir(d1)) # 1、contians
print('one' in d1) # 2、eq
print(d1 == d2) # 3、len
print(len(d1)) # 4、ne
print(d1 != d2) # 5、iter
print(iter(d1)) # 6、clear
d3.clear()
print(d3) # 7、copy
d4 = d1.copy()
print(d4) # 8、fromkeys
l = [1, 2, 3]
d5 = dict.fromkeys(l, 'w')
print(d5) # 9、get
print(d1.get('one'))
print(d1.get('three', 3)) # 10、items
print(d1.items()) # 11、keys
print(d1.keys()) # 12、pop
d = d1.pop('three', 3)
print(d)
print(d1)
d = d1.pop('one')
print(d)
print(d1) # 13、popitem
d = d2.popitem()
print(d)
print(d2) # 14、setdefault
d = d2.setdefault('one')
print(d)
print(d2)
d = d2.setdefault('three', 3)
print(d)
print(d2) # 15、update
d1.update({'three': 3})
print(d1) # 16、values
print(d1.values())

最新文章

  1. git基本配置
  2. [redis] Node is not empty. Either the node already knows other nodes
  3. order_by_、group_by_、having的用法区别
  4. php程序员的水平 看看自己属于那个级别的
  5. MYSQL 下一些常用操作命令:新建用户、修改密码、修改登录host等
  6. Maven搭建webService (三) 创建客户端---使用Apache CXF方式实现
  7. WPF 绑定四(层级绑定)
  8. Java基础知识强化之集合框架笔记21:数据结构之 数组 和 链表
  9. 使用Python做科学计算初探
  10. cf C. Bombs
  11. Shell 传递参数
  12. nefu117 素数个数的位数,素数定理
  13. MySQL启动出现The server quit without updating PID file错误解决办法
  14. 7. svg学习笔记-图案和渐变
  15. Eclipse启动错误JVM terminated. exit code 1解决方法
  16. [C++]2-1 水仙花数
  17. activiti学习第二天
  18. Excel、VBA与MySQL交互
  19. 深入理解L1、L2正则化
  20. Salesforce的翻译工作台

热门文章

  1. FastJson处理Map List 对象
  2. GPIO设备虚拟文件结点的创建【转】
  3. c# CODE REVIEW (13-11 TO 14-01)
  4. eclipse批量修改package、import中的包名
  5. jsp九大内置对象和其作用详解
  6. Use trained sklearn model with pyspark
  7. not in和not exist的区别(转)
  8. <opengl>使用glu绘制二次曲面
  9. css 跳转电脑分辨率
  10. AtCoder Regular Contest 073 E:Ball Coloring