WorksheetsFIXIT FEST - LEO CLUB (DAY - 2)
Total questions: 24
Worksheet time: 21mins
x = 5
y = 2
print(x * y + 3)
What will be the output of this code?
10
13
15
16
Which line contains the error in this Python code?
for i in range(5)
print(i)
Line 1
Line 2
Line 1 & 2
No Error
what will be PRINTED ?
[3, 4]
[2, 3]
[1, 2]
[4, 5]
a = 10
b = 3
c = a % b+3
print(c)
What is the output of this code?
3
2
4
1
Which line contains the error in this Java code?
public static void main(String[] args) {
int num = 2;
System.out.println(num / 0);
}
Line 3
Line 2
Line 1
No Error
def multiply(a, b):
return a * b
result = multiply(4, 5)
print(result)
What will be printed?
9
N/A
error
20
What will be the value of x after the following code executes?
x = 0
for i in range(1, 6):
x += i
print(x)
10
25
15
20
For the given image, What will be printed ?
5
2
3
None
Which line contains the error in this C++ code?
(start numbering line from main() )
Line 5
Line 3
Line 4
No Error
What will be Printed ?(Output)
3
8
5
9
Output of the following ?
5
10
3
8
def print_numbers():
for i in range(5):
print(i, end=" ")
print_numbers()
output for the above ?
0 1 2 3 4
0 1 2 3
1 2 3 4 5
1 2 3 4
function multiply(a, b) {
return a * b ; }
console.log(multiply(2));
Which line contains the error in this JavaScript code?
Line 1
Line 2
Line 3
No Error
def compute(num):
if num == 0:
return 1
else:
return num * compute(num-1)
result = compute(3)
What will be the value of result?
6
3
1
9
What will be printed?
16
17
18
19
What will be the output of this code?
16
32
64
128
Spot the error in this C code :
No Error
Line 5
Line 6
Line 3
What is the value of 'result' ?
5
15
10
8
Output ?
10
12
120
24
Which line contains Error ?
Line 4
Line 3
Line 2
No Error
def func(x):
if x == 0:
return 0
else:
return x + func(x-1)
x = func(5)
what is the value of 'x' ?
5
20
15
10
What will be the output of the following Python code?
for i in range(1, 6):
print(i * 2)
2 4 6 8 10
1 2 3 4 5
3 6 9 12 15
0 2 4 6 8
Identify the error in the following Java code:
public static void main(String[] args) {
int x = 10;
System.out.println(x / 0);
}
Line 3
Line 2
Line 1
No Error
What is the value of 'result' in the following JavaScript code?
function add(a, b) {
return a + b;
}
var result = add(5, 3);
7
8
15
53
