Parentheses pairing ({}[]()<>) issue
问题 I want to be able to pair up all parentheses in a string, if they aren't paired then then they get their index number and False. It seems like it is repeating some values over and over, i.e cl == pop[1]. I have tried to see where the problem is but I can't see it no matter how hard I try. So I'm asking if anyone help me to locate the error and maybe even improve my code ;) def check_parentheses(string): pending = 0 brackets = [] '''Checks if parens are paired, otherwise they are bad.'''