#Author wangmengzhu
##clear
# dic = {'k1':'v1','k2':'v2'}
# dic.clear()
# print(dic)
##copy
# dic = {'k1':'v1','k2':'v2'}
# v = dic.copy()
# print(v)
# print(dic)
# {'k1': 'v1', 'k2': 'v2'}
# {'k1': 'v1', 'k2': 'v2'}
##fromkeys
# dic = {}
# dic = dic.fromkeys(['k1','k2'],'num')
# print(dic)
##{'k1': 'num', 'k2': 'num'}
# dic = {'k1':'v1','k2':'v2'}
# v = dic.get('k1')
# print(v)##获取键值
##返回字典中所有的键值对
# dic = {'k1':'v1','k2':'v2'}
# v = dic.items()
# print(v)
##用于返回字典中的键
# dic = {'k1':'v1','k2':'v2'}
# v = dic.keys()
# print(v)
##获取并删除对应的value值
# dic = {'k1':'v1','k2':'v2'}
# v = dic.pop('k1')
# print(v)
# print(dic)
##随机删除一个键值对,并且获取删除的键值
# dic = {'k1':'v1','k2':'v2'}
# v = dic.popitem()
# print(v)
# print(dic)
##增加,如果键值对存在不做任何操作
# dic = {'k1':'v1','k2':'v2'}
# v = dic.setdefault('k3','v3')
# print(v)
# print(dic)
##批量增加或者修改
# dic = {'k1':'v1','k2':'v2'}
# v = dic.update({'k3':'v3','k1':'v6'})
# print(dic)
##取出字典中的值
# dic = {'k1':'v1','k2':'v2'}
# v = dic.values()
# print(v)