Problem Solving Using Recursion In Python