""" A skeleton of Stack using Python list. Students need to complete the implementation. CSCI 204, Spring 2020 Xiannong Meng """ class Stack : """ A stack class implemented using Python list. The end of the list, or list[n-1], is the 'top' of the stack""" def __init__( self ): """ Create the stack""" self._the_items = list() def __str__(self): ''' Create and return a string representation for the stack ''' s = "[" for i in range(len(self._the_items) - 1, -1, -1): s += str(self._the_items[i]) + " -> " return s def is_empty( self ): """ Check if empty """ pass def __len__ ( self ): """ Return the length """ pass def peek( self ): """ Return the top item of the stack""" pass def pop( self ): """ Return and remove the top element of the stack""" # you should make use of the Python list pop() function pass def push( self, item ): """ Add a new item to the top of the stack""" # you should make use of the Python list append function pass