map
遍历序列,对序列中每个元素进行操作,最终获取新的序列。
li = [11, 22, 33] new_list = map(lambda a: a + 100, li) #new_list = map(lambda a: a + 100, [11, 22, 33]) print(list(new_list))
遍历序列,对序列中每个元素进行操作,最终获取新的序列。
li = [11, 22, 33] new_list = map(lambda a: a + 100, li) #new_list = map(lambda a: a + 100, [11, 22, 33]) print(list(new_list))
相关文章: