''' Test the bacic operations of a stack ''' from list_stack import Stack #from pyliststack import Stack from random import randint s = Stack() for i in range(10): # generate 10 random int and push them onto stack v = randint(0, 100) print('pushing ', v, ' onto stack.') s.push(v) print('All values are on stack now ...') print(s) print('Is the stack empty? ', s.is_empty()) print('Top of the stack : ', s.peek()) while s.is_empty() != True: print('Popping off the top : ', s.pop()) print('Now the stack should be empty : ', s.is_empty())