Python Recursive Function Global Variable Example