字典
names = {'name':'lira','age':20,'gender':'女'}
print(names)
print(names['name'])
names['name']='rwby'
print(names)
names['phone']=12345678
print(names)
##通过键名修改数据,如果键名不存在则追加键值对
字典删除
del
del names清除字典
del names['name']##清除键值
print(names)
clear清空字典,保留空字典
names.clear()
查找字典
names = {'name':'lira','age':20,'gender':'女'}
##get
print(names.get('name'))
##keys
print(names.keys())##返回一个可迭代的对象
##values
print(names.values())
##items
print(names.items())