I am reading Learning Python and am having a hard time understanding what exactly the author is trying to convey here.
He says: because argument-unpacking syntax in calls accepts iterables, it's also possible to use the zip built in call to unzip zipped tuples, by making prior or nested zip results arguments for another zip call.
>>> X = (1, 2)
>>> Y = (3, 4)
>>> list(zip(X, Y))
[(1, 3), (2, 4)] # Zip tuples; returns an iterable.
>>> A, B = zip(*zip(X, Y)) # Unzip a zip!
>>> A
(1, 2)
>>> B
(3, 4)
I do not understand the point of the zip and then *zip? Wouldn't A, B = X, Y do the same thing. Can someone help explain this concept for me?