Unpacking in Python refers to an operation that consists of assigning an iterable of values to a tuple (or list ) of variables in a single assignment statement. ... Historically, Python developers have generically referred to this kind of operation as tuple unpacking.
What is unpacking a tuple in python?
Python Tuples In python tuples are used to store immutable objects. ... In another way, it is called unpacking of a tuple of values into a variable. In packing, we put values into a new tuple while in unpacking we extract those values into a single variable.
What is packing and unpacking?
The pack function takes a list of values to be packed as a second argument and returns a scalar character string containing the packed values. The unpack function takes a character string containing the values to be unpacked as a second argument, and returns a list of individual values extracted from the string.