dict dictionary, and the dictionary of some of the basic applications

dict representation:

dict={}或d=dict()

 

1, the dictionary by: d [ 'element name'] = 'element value' or d.setdefault ( 'key', 'value')

 

2, the dictionary deletion: d.pop (key), or del d [key]

 

3, change the dictionary

 

4, dictionary search: d.get (key), or d [key], or d.keys (), or d.values ​​()

 

Other applications 5, dictionary

 

6, the value of the key and value REVOLVE

 

Guess you like

Origin www.cnblogs.com/mihoutao/p/10944264.html