do_map.py 125 B

1234567
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. def f(x):
  4. return x * x
  5. print(list(map(f, [1, 2, 3, 4, 5, 6, 7, 8, 9])))