24
Question Question 3(h)
Carefully read the given code fragments and figure out the errors that the code may produce.
t = ( 'a', 'b', 'c', 'd', 'e')
1, 2, 3, 4, 5, = t
Output
SyntaxError: cannot assign to literal
Explanation
When unpacking a tuple, the LHS (left hand side) should contain a list of variables. In the statement, 1, 2, 3, 4, 5, = t, LHS is a list of literals not variables. Hence, we get this error.