← Quiz: The collections Module: all 10 questions
Quiz: The collections Module · Question 6 of 10
Which is true about a namedtuple?
Which is true about a namedtuple?
- A.Its fields can be read by name or by index, and it cannot be changed
- B.Its fields can be changed with normal assignment
- C.It cannot be unpacked
- D.It is a kind of dictionary
Answer & explanation
Correct answer: Its fields can be read by name or by index, and it cannot be changed
It is a real tuple with added field names.
Can you get the rest right without peeking?
Take the timed Quiz: The collections Module quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →