Recursive Function In Python Syntax Checker