>>> map(lambda x:x*2,a)
[10, 12, 14, 16, 18]
>>> a
[5, 6, 7, 8, 9]
列表推导式(list comprehension)
>>> rsc=[x **2 for x in range(4)]
>>> for i inrsc:
... print i,
...
0 1 4 9
>>> gmy=[x **2 for x in range(8) if not x % 2]
>>> for i ingmy:
... print i,
...
0 4 16 36