Since 15 is odd, $f(15, 10) = 2f(7, 10)$. In the same way $f(7, 10) = 2f(3, 10)$, $f(3, 10) = 2f(1, 10)$ and $f(1, 10) = 2f(0, 10) = 2 \times 10 = 20$. Going back, $f(3, 10) = 40$, $f(7, 10) = 80$ and $f(15, 10) = 160$. The value 160 is printed.
More Programming in Python questions
GATE 2024 DA Q38– Consider the following Python code: Which ONE of the following is the output of this code?
GATE 2024 DA Q39– Consider the function computeS(X) whose pseudocode is given below: Which ONE of the…
GATE 2024 DA Q41– Consider the following Python function: What does this Python function fun() do? Select…
GATE 2026 DA Q16– Consider the given Python program. Which of the following is the correct output of this…
GATE 2026 DA Q39– A recursive function in Python is given. Now, consider the following function call: Assume…
GATE 2026 DA Q50– Consider the given Python program. Which of the following options is/are correct?