types coded in use patterns similar to those here in the endthoughwe'll also see that python' built-in support can often take the place of homegrown solutions in this domain although custom data structure implementations are sometimes necessary and still have much to offer in terms of code maintenance and evolutionthey are not always as paramount in python as they are in less programmer-friendly languages implementing stacks stacks are common and straightforward data structureused in variety of applicationslanguage processinggraph searchesand so on for instanceexpression evaluation in the next calculator gui is largely an exercise in juggling stacksand programming languages in general typically implement function calls as stack operations in order to remember what to resume as calls return stacks can also help in xml parsingthey are natural for tracking progress any time constructs might be arbitrarily nested in shortstacks are last-in-first-out collection of objects--the last item added to the collection is always the next one to be removed unlike the queues we used for thread communicationwhich add and delete at opposite endsall the activity in stacks happens at the top clients use stacks bypushing items onto the top popping items off the top depending on client requirementsthere may also be tools for such tasks as testing whether the stack is emptyfetching the top item without popping ititerating over stack' itemstesting for item membershipand so on built-in options in pythona simple list is often adequate for implementing stackbecause we can change lists in place arbitrarilywe can add and delete items from either the beginning (leftor the end (righttable - summarizes various built-in operations available for implementing stack-like behavior with python lists and in-place changes they vary depending on whether the stack "topis the first or the last node in the listin this tablethe string 'bis the initial top item on the stack table - stacks as lists operation top is end-of-list top is front-of-list top is front-of-list new stack=[' '' 'stack=[' '' 'stack=[' '' 'push stack append(' 'stack insert( ,' 'stack[ : ]=[' ' data structures