#encoding=utf-8 class Queue(object): """队列""" def __init__(self): self.__items = [] def enqueue(self, item): """进队列""" self.__items.insert(0, item) def dequeue(self): """出队列""" return self.__items.pop() def is_empty(self): """判空""" return self.__items == [] def size(self): """返回大小""" return len(self.__items)