dict={1:1,2:'aa','D':'ee','Ty':45}print(dict['D'])
查看答案
dict={1:1,2:'aa','D':'ee','Ty':45}print(dict.get(2))
dict={1:1,2:'aa','D':'ee','Ty':45}foritemindict.items():print(item)
dict={1:1,2:'aa','D':'ee','Ty':45}forkey,valueindict.items():print(key,value)
dict={1:1,2:'aa','D':'ee','Ty':45}forkeyindict.keys():print(key)