python中,字典的使用频率非常高,这里对字典的创建、修改、删除、列表转字典等进行了详细的总节。
![v2-f14ad12f13c5e26c212fcce4836a522e_b.jpg](http://img-03.proxy.5ce.com/view/image?&type=2&guid=90094d7a-c22f-eb11-8da9-e4434bdf6706&url=https://pic3.zhimg.com/v2-f14ad12f13c5e26c212fcce4836a522e_b.jpg)
------------------------------------------------------------------------------------------
这里,是个简单的案例(有注释):
# -*- coding: utf-8 -*-
#创建字典,并读取字典
stuDict={"name":"张三","sex":1,"age":18,"parents":{"father":"张父","mother":"张母"},"friend_list":["小王","小李","小于"]}
print(stuDict["name"]) #张三
print(stuDict["parents"]) #{'father': '张父', 'mother': '张母'}
print(stuDict["parents"][