-2

I do understand this is an object, but can you throw some insights on how it is able to map to different lists?

Ajinkya Ghadge
  • 103
  • 1
  • 1
  • 6
  • 3
    I do not understand your question. What did you expect `print(zip(*A))` to print? What do you mean "map to different lists"? for example: https://stackoverflow.com/questions/19777612/python-range-and-zip-object-type – juanpa.arrivillaga Oct 22 '19 at 00:58

1 Answers1

0

In Python, the zip functions returns a custom iterator object that computes each tuple of items from the sequence it is given lazily. This object has no __repr__ method, so printing it produces the default <zip object at <address>>. The set constructor then evaluated the created iterator, creating a set of tuples. Sets do have a __repr__, so printing the set will produce the expected output.

pppery
  • 3,731
  • 22
  • 33
  • 46