WekaIO interview question

Check for balanced parentheses in Python