Unpack the tuple into 5 variables


Sample tuple :(11, 22, 333, 44, 55)

The program is written in Python. It creates a tuple "t" containing 5 elements (11, 22, 33, 44, 55). Then, the program uses tuple unpacking to assign each element of the tuple to a separate variable, named m, n, p, q, and r, respectively. Finally, the program prints each of these variables on a separate line using the "print" function.

Source Code

t = (11, 22, 33, 44, 55)
 
m, n, p, q, r = t
print(m)
print(n)
print(p)
print(q)
print(r)

Output

11
22
33
44
55

Example Programs