GATE 2024 Data Science and Artificial Intelligence question: Consider the following Python function: code What does this Python function fun() do?…
Consider the following Python function:
def fun(D, s1, s2):
if s1 < s2:
D[s1], D[s2] = D[s2], D[s1]
fun(D, s1+1, s2-1)
What does this Python function fun() do? Select the ONE appropriate option below.
Show answer
Official answer: C