When we see a space , we print contents of stack .
else : NEW_LINE INDENT while len ( st ) > 0 : NEW_LINE INDENT print ( st [ - 1 ] , end = " " ) NEW_LINE st . pop ( ) NEW_LINE DEDENT print ( end = " ▁ " ) NEW_LINE DEDENT