4.1字典
1.生成字典
names = [] ,salaries = [] ,dict[zip(names,salaries)]
dic = {key1:value1,key2:value2}
dic = dict([[key1,value1],[key2,value2]])
dic = dict(([key1,value1],[key2,value2]))
dic = dict(key1=value1,key2=value2)
sorted(dic)
2.字典基本使用
查找: dic[keys]或者dic.get(keys)不会返回错误
更新:dic[key1] = value1
添加:dic[key2] = value2
判断:value in dic
删除:del dic[key1]
3. 常用方法