Hi this code works in python 2.7 but not in python 3
import itertools
def product(a,b):
return map(list, itertools.product(a, repeat=b)
print(sorted(product({0,1}, 3)))
it outputs
[[0, 0, 0], [0, 0, 1], [0, 1, 0], [0, 1, 1], [1, 0, 0], [1, 0, 1], [1, 1, 0], [1, 1, 1]]
in python 2.7 but in python 3 it gives map object at 0x028DB2F0 does anyone know how to change this to work for python 3 so the output remains the same as in python 2.7