#!/usr/bin/env python3 # -*- coding: utf-8 -*- def f(x): return x * x r = map(f, [1, 2, 3, 4, 5, 6, 7, 8, 9]) # 结果r是一个Itertator,是惰性序列 # 通过list()函数让它把整个序列都计算出来并返回一个list print(list(r)) # [1, 4, 9, 16, 25, 36, 49, 64, 81] print(list(map(str, [1, 2, 3, 4…