LinkedIn Python Skill Assessment Quiz Answers

Which of these is NOT a characteristic of namedtuples?

Latest Update on 25th January, 2022 by Certification Course Answers

Which of these is NOT a characteristic of namedtuples?

  1.  You can assign a name to each of the namedtuple members and refer to them that way, similarly to how you would access keys in dictionary.
  2.  Each member of a namedtuple object can be indexed to directly, just like in a regular tuple.
  3.  namedtuples are just as memory efficient as regular tuples.
  4.  No import is needed to use namedtuples because they are available in the standard library.

Correct Answer:

  •  No import is needed to use namedtuples because they are available in the standard library.

**We need to import it using from collections import namedtuple **

Latest Updates

No posts found in this category.