Parenthesis matching in Python
Great language though it is, Python code can lead to statements with many, deeply-nested parentheses. Here's a little program with two functions to check that the parentheses in a string match and to find the locations of the matching parentheses. check_parentheses works by simply keeping …