#模拟栈结构
stack = []
#压栈(向栈里面存数据)
stack.append("A")
print(stack)
stack.append("B")
stack.append("C")
print(stack)
#出栈(在栈里面取数据)
res1 = stack.pop()
print(res1)
print(stack)
res2 = stack.pop()
print(res2)
print(stack)
res3 = stack.pop()
print(res3)
print(stack)
#模拟队列
import collections
#创建队列
queue = collections.deque()
print(queue)
#进队
queue.append("A")
print(queue)
queue.append("B")
print(queue)
#出队
res1 = queue.popleft()
print(res1)
print(queue)
res2 = queue.popleft()
print(res2)
print(queue)