1. num_1 = [10,2,3,4] def map_test(array): ret = [] for i in num_1: ret.append(i**2) # 列表里每个元素都平方 return ret res = map_test(num_1) print(res) 运行结果: [100, 4, 9, 16] Process finished with exit code 0 2.也可以用lambda num_1 = [10,2,3,4] def add_one(x): # 用匿…