Computer Science
Consider the following code and find out the error:
t1 = (10, 20, 30, 40)
X, Y, Z = t1
Python Tuples
1 Like
Answer
The code will result in an Error because the number of variables on the left side of the assignment (X, Y, Z) does not match the number of elements in the tuple t1.
Answered By
1 Like
Related Questions
Consider the following code and find out the error:
tup1 = ('a', 'b', 'c') tup1 = tup1 + dConsider the following code and find out the error:
tup1 = ("Riya", ) * '4'Consider the following code and find out the error:
tup1=('A', 'school', 10.5, 70) print max(tup1)Consider the following code and find out the error:
t = (10, 20, 30, 40) t[1] = 'o'