Login / Register
  1. Home
  2. Data Science and Artifici...

Filters

Found 3 Questions

Set Default
Exams
Subjects
Topics

List of top Data Science and Artificial Intelligence Questions on Programming in Python

Consider the following Python function :
def fun (D, s1, s2) :
if s1 s2:
D[s1], D[s2] = D[s2], D[sl]
fun (D, s1+1, s2-1)
What does this Python function fun () do? Select the ONE appropriate option below.
  • GATE AR - 2024
  • GATE AR
  • Data Science and Artificial Intelligence
  • Programming in Python
Consider the function computes (X) whose pseudocode is given below :
\(\frac{\text{computeS (X)}}{S[1] ←1}\)
for i ← 2 to length(X)
S[i] ← 1
if X[i-1] ≤ X[i]
S[i] ← S[i] + S[i - 1]
end if
end for
return S
Which ONE of the following values is returned by the function computeS (X) for X= [6, 3, 5, 4, 10] ?
  • GATE AR - 2024
  • GATE AR
  • Data Science and Artificial Intelligence
  • Programming in Python
Consider the following Python code :
def count (child_dict, i) :
if i not in child_dict.keys() :
return 1
ans = 1
for j in child_dict[i] :
ans += count (child_dict, j)
return ans
child_dict = dict()
child_dict [0] = [1, 2]
child_dict [1] = [3, 4, 5]
child_dict [2] = [6, 7, 8]
print (count(child_dict,0))
Which ONE of the following is the output of this code ?
  • GATE AR - 2024
  • GATE AR
  • Data Science and Artificial Intelligence
  • Programming in Python
contact us
terms & conditions
Privacy & Policy
© 2025 Zollege Internet Private Limited