I'm a Python newbie reading an old Python book. It's based on Python 2, so sometimes I got little confused about detail.
There is a code
L=map(lambda x:2**x, range(7))
so it doesn't return the list in python 3, and I googled it and found that list(L
) works.
But the problem is, first list(L)
works fine,
but when I use it again,
list(L)
list(L)
second one returns [ ]
Can somebody explain me what's happening?