Intermediate
Python
Q68 / 101
What is a namedtuple?
Correct! Well done.
Incorrect.
The correct answer is A) A tuple subclass with named, accessible fields
A
Correct Answer
A tuple subclass with named, accessible fields
Explanation
namedtuple("Point", ["x", "y"]) creates a tuple subclass whose fields are accessible as attributes (p.x) as well as by index (p[0]).
Progress
68/101