I'm looking at this and can't see how it works, although I understand zipping and unpacking. The docs say it's a Python idiom. Does "idiom" mean it works in a special way so I can't figure it out from basic principles? It looks to me like the iterator in the list gets doubled, so the zip should make it [(1,1),(2,2),(3,3),... ], not [(1,2),(3,4),...]
What am I missing here? >>> s = [1,2,3,4,5,6,7,8] >>> list(zip(*[iter(s)]*2)) >>> [(1, 2), (3, 4), (5, 6), (7, 8)] https://docs.python.org/3/library/functions.html#zip -- Jim _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor