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
4、
a = [ i+1 for i in range(10)]
print a
时间: 2024-11-15 11:18:39