Computer Science
Answer
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.
Related Questions
Find the output generated by following code fragments :
(a, b, c) = (1, 2, 3)
Find the output generated by following code fragments :
(a, b, c, d) = (1, 2, 3)
Find the output generated by following code fragments :
a, b, c, d, e = (p, q, r, s, t) = t1
a, b, c, d, e = (p, q, r, s, t) = t1
What will be the values and types of variables a, b, c, d, e, p, q, r, s, t if t1 contains (1, 2.0, 3, 4.0, 5) ?