Q1medium
Trace the logic:
x = [1, 2, 3]
y = x
y[0] = 99
print(x[0])
Assuming x and y are reference types (like in Python or JS):Topic-wise practice questions for Problem Solving & Analytical Skills. Test your knowledge, check solutions on demand, and pace your preparation.
x = [1, 2, 3]
y = x
y[0] = 99
print(x[0])
Assuming x and y are reference types (like in Python or JS):
val = 1
for i from 1 to 3:
val = val * i
print(val)
total = 0
for i from 1 to 5:
if (i % 2 == 0):
total = total + i
print(total)
num1 = 10
num2 = 20
num3 = 30
average = num1 + num2 + num3 / 3