Vidyalelo
Python · Q40

MCQs on Python Tuples: Exam

Programming · Python · question 40

Q40

What will be the output of the following Python code? >>> import collections >>> a=collections.namedtuple('a',['i','j']) >>> obj=a(i=4,j=7) >>> obj

A.
a(i=4, j=7)
Answer
B.
obj(i=4, j=7)
C.
(4,7)
D.
An exception is thrown

Answer: Option A

Solution

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