标签:blog io for div sp on c log new
用途:用已知的列表生成一个新的列表
list_comprehension.py
old_list = [5,6,7] new_list = [ 2*i for i in old_list if i%2] print new_list
输出
[10,14]
标签:blog io for div sp on c log new
原文地址:http://www.cnblogs.com/sluggard/p/3991865.html