KnowledgeBoat Logo

Computer Science

Carefully read the given code fragments and figure out the errors that the code may produce.

t = ( 'a', 'b', 'c', 'd', 'e') 
1n, 2n, 3n, 4n, 5n = t

Python Tuples

1 Like

Answer

Output
SyntaxError: invalid decimal literal 
Explanation

This error occurs when we declare a variable with a name that starts with a digit. Here, t is a tuple containing 5 values and then we are performing unpacking operation of tuples by assigning tuple values to 1n,2n,3n,4n,5n which is not possible since variable names cannot start with numbers.

Answered By

3 Likes


Related Questions