map( function, iterable)
[dywang@deyu zzz]$ cat function9.py
#!/usr/bin/python3
# coding: utf-8
xlist = [1, 2, 3, 4, 5, 6, 7, 8, 9]
squarelist = map(lambda x : x**2, xlist)
print("square of xlist:", squarelist)
[dywang@deyu zzz]$ ./function9.py square of xlist: <map object at 0x7f8335e4d208>
[dywang@deyu zzz]$ cat function9a.py
#!/usr/bin/python3
# coding: utf-8
xlist = [1, 2, 3, 4, 5, 6, 7, 8, 9]
squarelist = list(map(lambda x : x**2, xlist))
print("square of xlist:", squarelist)
[dywang@deyu zzz]$ ./function9a.py square of xlist: [1, 4, 9, 16, 25, 36, 49, 64, 81]