Recursive Function Program In Python Using Loop