python
dictionary and list
- create
<python>
list =[]
addition
<python>
test.append('a')
test.extend(['a','b','c','d'])
test.insert(2,'g')delete
test.remove('a')
del .test[3] ///'index'
if 'a' in test:
second =test.pop(1)``
- sort
```<python>
new_test = test[:]
new_test.so
- sorted
new_test = sorted(test)
- sort the list
for key in sorted(test.keys()):
print key , test[key]
- sort the value
for value in sorted(test.values()):
for key in test.keys():
if test[key] == value //test[key]键的调用
print key, test[key]