class QueueError(Exception):
    pass


class Queue:
    def __init__(self):
        self.__queue_list = []

    def put(self, val):
        self.__queue_list.insert(0, val)

    def get(self):
        if len(self.__queue_list) < 1:
            raise QueueError("Errore di coda")
        return self.__queue_list.pop()

que = Queue()

que.put(1)
que.put("cane")
que.put(False)

try:
    for i in range(4):
        print(que.get())
except:
    print("Errore di coda")