public interface Map<K,V> 将键映射到值的对象.一个映射不能包含重复的键:每个键最多只能映射到一个值. import java.util.HashMap; import java.util.Map; public class Test1 { public static void main(String[] args) { Map map = new HashMap();//声明一个Map map.put("s", "哈哈");//
python源码解释如下:map(func, *iterables) --> map objectMake an iterator that computes the function using arguments fromeach of the iterables. Stops when the shortest iterable is exhausted.简单来说, map()它接收一个函数 f 和一个 可迭代对象(这里理解成 list),并通过把函数 f 依次作用在 list 的每个元素