Python基础知识(12):函数(Ⅲ) 高阶函数 1.map map()函数接收两个参数,一个是函数,一个是Iterable,map将传入的函数依次作用到序列的每个元素,并把结果作为新的Iterator返回. def test(x): return x+2 n=map(test,[1,2,3,4,5]) list(n) 结果: [3, 4, 5, 6, 7] 把列表中的数字转换成字符串 list(map(str,[1,2,3,4,5])) 结果: ['1', '2', '3', '4', '5…