Vidyalelo
Python · Q34

MCQs on Python Tuples: Exam

Programming · Python · question 34

Q34

Is the following Python code valid? >>> a=(1,2,3) >>> b=('A','B','C') >>> c=tuple(zip(a,b))

A.
Yes, c will be ((1, 'A'), (2, 'B'), (3, 'C'))
Answer
B.
Yes, c will be ((1,2,3),('A','B','C'))
C.
No because tuples are immutable
D.
No because the syntax for zip function isn't valid

Answer: Option A

Solution

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