1. map() 函数的功能: map(f, [x1,x2,x3]) = [f(x1), f(x2), f(x3)] def f(x): return x*x a = map(f, [1, 2, 3, 4, 5]) b = map(f, (6, 7, 8, 9)) print a print b # [1, 4, 9, 16, 25] # [36, 49, 64, 81] # a = map(f, 1,2,3,4,5,6,7) # print a # Traceback (most recent