Vidyalelo
Python · Q55

MCQs on Python Tuples: Exam

Programming · Python · question 55

Q55

Is the following Python code valid? >>> a,b=1,2,3

A.
Yes, this is an example of tuple unpacking. a=1 and b=2
B.
Yes, this is an example of tuple unpacking. a=(1,2) and b=3
C.
No, too many values to unpack
Answer
D.
Yes, this is an example of tuple unpacking. a=1 and b=(2,3)

Answer: Option C

Solution

Answer: Option C
No explanation is given for this question Let's Discuss on Board