- collections.namedtuple
- collections.deque
- collections.Counter
- collections.OrderedDict
- collections.defaultdict
We can use namedtuple to enhance the code readable of a simple kind of class.
The name is double-ended queue. The benfit is that the complexity time of pop() and insert() is speedy.
l.append(5)
l.pop()list time complexity are O(n) after used them.
deque time complexity are O(1) after used them.
Just as the name, easy to count the same key in a dict.
Almost the same as dict, it just adds the order by inputing time.
Almost the same as dict, users can define the default value.