I do understand this is an object, but can you throw some insights on how it is able to map to different lists?
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.