Python program to unpack the list and tuples

A Python program to unpack the list and tuples. In this program we can print the unpacking the list and tuples in python. Python utilises commas (, ) instead of parentheses to define a tuple. Individual elements of a tuple are assigned to numerous variables while unpacking tuples. To assign the remaining items of an unpacking assignment to a list and assign it to a variable, use the * operator.

inlarn = ["java", "python", "c"]
x, y, z = inlarn
print(x)
print(y)
print(z)

 

Output:

java
python
c