Base Case In Recursive Function In Python