1

I tried this simple code in jupyter notebook, the result doesn't show properly.

my code:

z = map(lambda x, y: (x+y)**2, x, y)
z

instead of showing numbers, it shows:

map at 0x164ecbec7b8

I tried in Pycharm too, it doesn't work either. How do I fix it? cheers!

Lev Zakharov
  • 2,409
  • 1
  • 10
  • 24
Karen Jiang
  • 175
  • 1
  • 3
  • 12
  • In Python 3 `map` returns iterator. So if you want to get list of numbers just convert it using `list`: `z=list(map(lambda x,y:(x+y)**2,x,y))`. – Lev Zakharov Aug 18 '18 at 14:33

0 Answers0