1.字符串合并
- https://docs.python.org/2/library/stdtypes.html#str.join
- https://docs.python.org/2/library/string.html#string.join #注意分辨它和常用的str.join()的区别!
- http://stackoverflow.com/questions/493819/python-join-why-is-it-string-joinlist-instead-of-list-joinstring
- Efficient String Concatenation in Python
2.字典合并
- http://stackoverflow.com/questions/4841868/python-dictionaries-how-to-keep-the-new-value-from-overwriting-the-previous-valu
- http://stackoverflow.com/questions/6354436/python-dictionary-merge-by-updating-but-not-overwriting-if-value-exists
- http://stackoverflow.com/questions/38987/how-can-i-merge-two-python-dictionaries-in-a-single-expression
3.列表合并
http://stackoverflow.com/questions/952914/making-a-flat-list-out-of-list-of-lists-in-python
4.嵌套字典的删除
5.组合
- http://stackoverflow.com/questions/5575124/python-combine-several-nested-lists-into-a-dictionary
- http://stackoverflow.com/questions/7271385/how-do-i-combine-two-lists-into-a-dictionary-in-python
6.去重
- http://en.wikibooks.org/wiki/Python_Programming/Sets
- Fastest way to uniqify a list in Python – Peterbe.com
- http://stackoverflow.com/questions/12878833/python-unique-list-using-set
7.其它
跳出[当前]循环
- http://search.aol.com/aol/search?q=Python+jump+out+current+circle
- http://stackoverflow.com/questions/189645/how-to-break-out-of-multiple-loops-in-python
《“Python中的各种合并/删除-跳出循环”》 有 1 条评论
Python编码中如何跳出多层循环?
http://stackoverflow.com/questions/653509/breaking-out-of-nested-loops
http://stackoverflow.com/questions/189645/how-to-break-out-of-multiple-loops-in-python
`
首先,Python中没有诸如C语言中的goto语句用来跳出多层嵌套循环,所以,如果你的Python代码中出现了这样的情况,第一选择应该是重构代码,将嵌套循环部分代码封装成一个function,用return进行替代。
`