queue = [] def enQ(): queue.append("A") def deQ(): if len(queue) == 0: print 'Cannot pop from an empty queue!' else: print 'Removed [', 'queue.pop(0)', ']' def viewQ(): print queue # calls str() internally enQ() viewQ() deQ() viewQ()