if top is - 1 , that means stack is empty
if ( top == - 1 ) : NEW_LINE INDENT print ( " Stack ▁ is ▁ Empty " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " Stack : ▁ " , end = ' ' ) NEW_LINE for i in range ( top + 1 ) : NEW_LINE INDENT print ( a [ i ] , end = ' ▁ ' ) NEW_LINE DEDENT print ( ) NEW_LINE DEDENT