The collections Module for Specialized Container Types in Python


Explore the collections module for useful container types like namedtuple, defaultdict, Counter, and deque.

Source Code

from collections import namedtuple, defaultdict, Counter
Point = namedtuple('Point', ['x', 'y'])
point = Point(10, 20)
print(point.x)
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments