stacks in the previous we used the python list and linked list structures to implement variety of container abstract data types in this we introduce the stackwhich is type of container with restricted access that stores linear collection stacks are very common in computer science and are used in many types of problems stacks also occur in our everyday lives consider stack of trays in lunchroom when tray is removed from the topthe others shift up if trays are placed onto the stackthe others are pushed down the stack adt stack is used to store data such that the last item inserted is the first item removed it is used to implement last-in first-out (lifotype protocol the stack is linear data structure in which new items are addedor existing items are removed from the same endcommonly referred to as the top of the stack the opposite end is known as the base consider the example in figure which ( ( ( (dfigure abstract view of stack(apushing value (bpushing value (cresulting stack after and are addedand (dpopping top value