a=[1,2,3,4,5]
b=list(map(str,a)) #b的值为[‘1’, ‘2’, ‘3’, ‘4’,‘5’]
c=list(map(lambda x:x*2,[1,2,3,4])) #c的值为[2,4,6,8]
d=list(map(lambda x:len(x),“I like you”.split())) #该函数可计算出每个单词的长度,d的值为[1,4,3];“I like you”.split()的值为[‘I’,‘like’,‘you’];
a=[1,2,3,4,5]
b=list(map(str,a)) #b的值为[‘1’, ‘2’, ‘3’, ‘4’,‘5’]
c=list(map(lambda x:x*2,[1,2,3,4])) #c的值为[2,4,6,8]
d=list(map(lambda x:len(x),“I like you”.split())) #该函数可计算出每个单词的长度,d的值为[1,4,3];“I like you”.split()的值为[‘I’,‘like’,‘you’];