How To Write Recursive Function In Python