1、
list = [0,1,2,3,4,5,6,7,8,9]
num = map(lambda x:x+1,list)
print num
2、
list1=[]
for i in list:
i=i+1
list1.append(i)
print list1
3、
for index,i in enumerate(list):
list[index] += 1
print list
enumerate另一种用法:
for index in enumerate(list,10):
print index
(10, 0)
(11, 1)
(12, 2)
(13, 3)
(14, 4)
(15, 5)
(16, 6)
(17, 7)
(18, 8)
(19, 9)
4、
a = [ i+1 for i in range(10)]
print a