4
Question Question 1(d)
Find the output generated by following code fragments :
a, b, c, d = (1, 2, 3)Output
ValueError: not enough values to unpack (expected 4, got 3)
Explanation
Tuple unpacking requires that the list of variables on the left has the same number of elements as the length of the tuple. In this case, the list of variables has one more element than the length of the tuple so this statement results in an error.