Deque- queues at both ends, keeping only the specified n elements
From collections import dequeq = deque (maxlen=5) for x in range (10): q.append (x) Q
Maxlen: retains elements of specified length
From collections import dequeq = deque (maxlen=5) for x in range (10): q.append (x) Q
Maxlen: retains elements of specified length