Jun-12-2020, 08:36 PM
To add to buran's reply
Wording taken direct from the python docs Wrote:d = 1, 2, 3The statement t = 12345, 54321, 'hello!' is an example of tuple packing: the values 12345, 54321 and 'hello!' are packed together in a tuple.
The reverse operation is also possible:
x, y, z = tThis is called, appropriately enough, sequence unpacking and works for any sequence on the right-hand side. Sequence unpacking requires that there are as many variables on the left side of the equals sign as there are elements in the sequence. Note that multiple assignments are really just a combination of tuple packing and sequence unpacking.