Python Programming - Tuples - Discussion

Discussion Forum : Tuples - General Questions (Q.No. 30)
30.
How do you unpack the elements of a tuple into separate variables?
var1, var2, var3 = tuple
var1 = tuple[0], var2 = tuple[1], var3 = tuple[2]
var1 = unpack(tuple)
var1, var2, var3 = unpack(tuple)
Answer: Option
Explanation:
Using the unpacking syntax, you can assign the elements of a tuple to separate variables.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.