dict= {}
dict['one'] ="this is one"
dict[2] ="this is two"
tinyDict = {'name':'john','code':6734,'dept':'sales'}
'''
print dict['one'] #输出键为'one'的值
print dict[2]#输出键为2
print tinyDict.keys() #输出所有jian
print tinyDict.values()#输出所有值
'''
#tinyDict.pop("name")#删除指定的
#print tinyDict
#tinyDict.popitem()#随机返回并删除字典中的一对键和值(一般删除末尾对)。
#print tinyDict
#tinyDict.setdefault("dfjfj","dfjiejfe") #和get()类似, 但如果键不存在于字典中,将会添加键并将值设为default
#print tinyDict
#tinyDict.update(dict)#把字典dict的键/值对更新到tinyDict里
#print tinyDict
#c = dict.fromkeys([6,7,8],[1,{"name":"alex"},444])
#print c
#c[7][1]["name"] = "jack" #全改
#print c
#字典的循环
foriintinyDict:
print(i,tinyDict[i])