Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Round 3: Coding Round

Total questions: 24

Worksheet time: 30mins

Name
Class
Date
1.

1)What is the output of the functions shown below?

float('1e-003')

float('2e+003')

a)

a) 3.00 and 300

b)

b) 0.001 and 2000.0

c)

c) 0.001 and 200

d)

d) Error and 2003

2.

Which of the following is not a valid way to handle exceptions in Python?

a)

A) try -except block

b)

B) finally block

c)

c) catch block

d)

d) else block

3.

3)Which header file uses-> gets()

a)

Studio. h

b)

Stdlib.h

c)

Conio.h

d)

All of the above

4.

4)Which of the following is an important requirement of c programming?

a)

Function

b)

Input variables

c)

Output variables

d)

All of the above

5.

5)In the following options which are python libraries which are used for data analysis and scientific computations

a)

Numpy

b)

Scipy

c)

Pandas

d)

All of the above

6.

6)In the following options which are python libraries which are used for data analysis and scientific computations

a)

Intrepreted language

b)

portable

c)

High level Language

d)

More than one of the above

e)

None of the above

7.

)Which data structure is efficient to search the string in the dictionary that is containing a large number of strings?

a)

A) Graph

b)

B) Trie

c)

C) Array

d)

D) HashMap

8.

8)Ramesh is working on array and he wants to pass the array to a function. If he is passing the array as an argument to a function, what actually he is passing?

a)

A)The starting index of the array

b)

B) The memory address of the first element of the array

c)

C) The size of the array

d)

D) A pointer to the first element of the array

9.

9)Which bitwise operator is suitable for turning off a particular bit in a number?

a)

&&

b)

|

c)

&

d)

<<

10.

10)Which of the following is not a valid way to handle exceptions in Python?

a)

try -except block

b)

finally block

c)

catch block

d)

else block

11.

11)List is ……. Data structure

a)

mutable

b)

immutable

c)

both mutable & immutable

d)

None

12.

12)give correct order naming for further symbols used in python

Symbols

/ // %

a)

slash ,

double slash ,

percent

b)

div,

floor divi,

modulus

c)

floor divi,

div,

modulus

d)

none

13.
13)What is the output of the following a=[1,2,3,2,5]
b=2, c=[]
for i in a: c.append(i^b)
a)

A) [3,0,5,7,0]

b)

B) [3,0,1,6,1]

c)

C) [3,0,1,0,5]

d)

D) [3,0,1,0,7]

14.

14) What is the output of the following

def my_func(n):

if n == 0:

return 0

elif n == 1:

return 1

else:

return my_func(n-1) + my_func(n-2)

print(my_func(6))

a)

A) 8

b)

B) 12

c)

C) 6

d)

D) 15

15.

15) What will be the result of the num1 variable after execution of the following statements?

int j = 1, num1 = 4;

while (++j <= 10)

{

num1++;

}

a)

A) 13

b)

B) 12

c)

C)14

d)

D)17

16.

16) What is the output of the following

#include <stdio.h>

int main()

{

int i = 3;

printf("%d", (++i)++);

return 0;

}

a)

A) 7

b)

B) 9

c)

C) 11

d)

D) Error

17.

17) What is the output of the following

def outer_function(x):

def inner_function(y):

return x * y

return inner_function

double = outer_function(2)

triple = outer_function(3)

print(double(4))

print(triple(4))

a)

A) 8 , 12

b)

B) 2, 3

c)

C) 16 ,24

d)

D) 4,6

18.

18) What is the output of the following

#include <stdio.h>

int main() {

int arr[] = {1, 2, 3, 4, 5};

int *p = arr + 2;

printf("%d\n", p[1]);

return 0;

}

a)

A) 1

b)

B) 2

c)

C) 3

d)

D) 4

19.

19)What will be the output of program?

main()

{

int n=(5,10,15);

cout<<n;

}

a)

5

b)

10

c)

15

d)

error

20.

20) output ?

i=0

j=20

while i < j:

i = i+5

j = j - 5

print( i , j )

a)

5 15

10 10

b)

15 15

10 10

c)

10 15

10 15

d)

none

21.

21) Output?

i=0

t=1

while i<=10:

if i%2==0:

t=t+1

i=i+1

print(t)

a)

5

b)

6

c)

7

d)

8

22.

22) Output?

t=0

for i in range(10):

if i%2==0:

t=t+i

else:

t=t+1

print(t)

a)

18

b)

19

c)

24

d)

25

23.

23) Output?

n=1996

if n%400==0:

print("Leap Year")

elif n%100==0:

print("Not Leap Year")

elif n%4==0:

print("Leap Year")

else:

print("Not Leap Year")

a)

Not Leap Year

b)

Leap Year

c)

leap year

d)

not leap year

24.

24) What is the output of the following

If n is the size of input(positive), which function is most efficient(if the task to be performed is not an issue)?

a)

A) for(i = 0; i < n; i++)

b)

B) for(i = 0; i < n; i += 2)

c)

C) for(i = 1; i < n; i *= 2)

d)

D) for(i = n; i <= n; i /= 2)

e)

E)None