Creating empty deque:
dl = deque() # deque([]) creating empty deque
Creating deque with some elements:
dl = deque([1, 2, 3, 4]) # deque([1, 2, 3, 4])
Adding element to deque:
dl.append(5) # deque([1, 2, 3, 4, 5])
Adding element left side of deque:
dl.appendleft(0) # deque([0, 1, 2, ...