Question 14
What is the output of the following snippet of code? def doSomething(x, y): if x < y: return 0 return 1 + doSomething(x // y, y) log1 = doSomething(81, 3) log2 = doSomething(64, 2) log3 = doSomething(125, 5) print(log1 + log2 + log3)
What is the output of the following snippet of code? def doSomething(x, y): if x < y: return 0 return 1 + doSomething(x // y, y) log1 = doSomething(81, 3) log2 = doSomething(64, 2) log3 = doSomething(125, 5) print(log1 + log2 + log3)
A written answer, not marked automatically.
Question 14 of 20 in the IIT Madras BS Programming in Python (Python) End Term paper sat on 21 Dec 2025, in the September 2025 term (Intro to Python 18 Dec 25). It carries 3 marks.