May 2018
Intermediate to advanced
380 pages
9h 37m
English
Let's walk through an example from https://docs.python.org/3/library/collections.html#collections.deque:
>>> from collections import deque
>>> d = deque("ghi")
>>> for elem in d: ... print(elem.upper()) G H I
>>> d.append('j') # add a new entry to the right side >>> d.appendleft('f') # add a new entry to the left side
>>> d # show the representation of the deque deque(['f', 'g', 'h', 'i', 'j'])
>>> d.pop() 'j' >>> d.popleft() ...