from collections import deque

# items = deque([])
items = deque(['foo', 'bar'])

print(type(items)) # <type 'collections.deque'>
print(items) # deque(['foo', 'bar'])

items.append('zorg')
print(items) # deque(['foo', 'bar', 'zorg'])
print(len(items)) # 3
items.append('zorg')
print(items) # deque(['foo', 'bar', 'zorg', 'zorg'])
nxt = items.popleft()
print(nxt) # 'foo'
print(items) # deque(['bar', 'zorg', 'zorg'])
print(len(items)) # 3

if items:
    print("The queue has items")
else:
    print("The queue is empty")
# • .append
# • .popleft
# • len() number of elements
# • if q: to see if it has elements or if it is empty
# • dequeue
from collections import deque

# items = deque([])
items = deque(['foo', 'bar'])

print(type(items)) # <type 'collections.deque'>
print(items) # deque(['foo', 'bar'])

items.append('zorg')
print(items) # deque(['foo', 'bar', 'zorg'])
print(len(items)) # 3
items.append('zorg')
print(items) # deque(['foo', 'bar', 'zorg', 'zorg'])
nxt = items.popleft()
print(nxt) # 'foo'
print(items) # deque(['bar', 'zorg', 'zorg'])
print(len(items)) # 3

if items:
    print("The queue has items")
else:
    print("The queue is empty")
# • .append
# • .popleft
# • len() number of elements
# • if q: to see if it has elements or if it is empty
# • dequeue
# items = deque([]) # <type 'collections.deque'> # deque(['foo', 'bar']) # deque(['foo', 'bar', 'zorg']) # 3 # deque(['foo', 'bar', 'zorg', 'zorg']) # 'foo' # deque(['bar', 'zorg', 'zorg']) # 3 # • .append # • .popleft # • len() number of elements # • if q: to see if it has elements or if it is empty # • dequeue