Python: Iterator to List

By Xah Lee. Date: .
list(iterator_obj)
Return a list represented by iterator_obj.
def ff(nn):
    return nn + 1

s1 = [1, 2, 3, 4]
s2 = map(ff, s1)

print(list(s2) == [2, 3, 4, 5])

Python Data Structure