Infosys UK Interview Question

Recursion in python with therotical explanation