parenthesis matching in python using stack
I am trying to use stacks to check parenthesis, but the following code cannot output the right result; after checking it several times, I still cannot find the mistakes; any hint or help is appreciated a lot! thanks!