Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. >>> def n2(n):
  2. ... return n*n
  3. ...
  4. >>> fact = n2
  5. >>> fact
  6. <function n2 at 0x000002320B7FC1E0>
  7. >>> fact(5)
  8. 25
  9. >>> map(n2, range(11))
  10. <map object at 0x000002320D7752E8>
  11. >>> list(map(fact, range(11)))
  12. [0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement