#! f:\python
#Filename : list_comprehension.py
listone = [2,6,8]
#Filename : list_comprehension.py
listone = [2,6,8]
listtwo = [2*i for i in listone if i>2]
print listtwo
输出:
>>> ================================ RESTART ================================
>>>
[2, 6, 8]
[12, 16]
>>>