Test 4 O Level M3

1 / 100

What will be the output of the following
Python code ?
def power(x, y=2):
r=1
for i in range(y):
r=r*x
return r
print (power(3))
print (power(3,3))

2 / 100

Hierarchy in a pseudo-code can be shown
by :

3 / 100

What will be the output of the following
Python code ?
tuple1=(5,1,7,6,2)
tuple1.pop(2)
print(tuple1)

4 / 100

What is the output of the following ?
x=123
for i in x:
print(i)

5 / 100

Which translator is used to convert assembly
language into machine language ?

6 / 100

A detailed flow chart is called as __________.

7 / 100

Given a string x=”hello” What is the output
of x.count(‘l’) ?

8 / 100

What will be output for the following code ?
import numpy as np
a = np.array( [2, 3, 4, 5] )
print(a.dtype)

9 / 100

What will be the output of the following
Python code ?
def display(b, n):
while n>0:
print(b, end=””)
n=n-1
display(‘z’, 3)

10 / 100

The correct extension of the Python file is
____________.

11 / 100

What will be the output of the following
Python code ?
len([“hello”,2, 4, 6])

12 / 100

What will be the output of the following
Python code ?
d1={“abc”:5,”def”:6,”ghi”:7}
print(d1[0])

13 / 100

Python is written in __________.

14 / 100

The connector symbol for flow chart is
__________.

15 / 100

Which of the following will read entire
content of file (file object ‘f’) ?

16 / 100

Which of the following is used to define a
block of code in Python language ?

17 / 100

What will be the output of the following code
snippet ?
numbers = (4, 7, 19, 2, 89, 45, 72, 22)
sorted_numbers = sorted(numbers)
odd_numbers = [x for x in sorted_numbers if
x % 2 != 0]
print(odd_numbers)

18 / 100

What will be the output of the following
Python code ?
def func(a, b=5, c=10):
print(‘a is’, a, ‘and b is’, b, ‘and c is’, c)
func(13, 17)
func(a=2, c=4)
func(5,7,9)

19 / 100

Which one of the following is immutable data
type ?

20 / 100

What is the output of the following code ?
def s(n1):
print(n1)
n1 = n1 +2
n2=4
s(n2)
print(n2)

21 / 100

The contents inside the “for loop” are
separated by :

22 / 100

What will be the output of the following
expression ?
x = 14
print(x>>2)

23 / 100

When we open file in append mode the file
pointer is at the _________ of the file.

24 / 100

What is the output of the following ?
m = 0
while m < 5:
print(m)
m += 1
if m == 3:
break
else:
print(0)

25 / 100

Which statement is correct to import all
modules from the package ?

26 / 100

Pictorial representation of an algorithm is
called as __________.

27 / 100

What is the output of the following ?
print(max([1, 2, 3, 4], [4, 5, 6], [7]))

28 / 100

What is the output of the following ?
n=5
while n>0:
n-=1
if n ==2:
continue
print(n)

29 / 100

What will be the output of the following ?
print(sum(1,2,3))

30 / 100

Debugging is the process of fixing a
__________ in the software.

31 / 100

What is the value of the following Python
code ?
>>>print(36 / 4)

32 / 100

Which of the following will delete key-value
pair for key=”tiger” in dictionary ?
dic={“lion”:”wild”,”tiger”:”wild”,”cat”:”domestic”,
“dog”.”domestic”}

33 / 100

What is the output of the following code ?
a = set(‘abc’)
b = set(‘cdef’)
print(a&b)

34 / 100

What will be output for the following code ?
import numpy as np
ary = np.array([1,2,3,5,8])
ary = ary + 1
print (ary[1])

35 / 100

In python language, which of the following
cannot be defined as variable ?

36 / 100

What type of data is : arr = [(1, 1), (2, 2),
(3, 3)] ?

37 / 100

What will be the output of the following code
snippet ?
from math import *
a = 2.19
b = 3.999999
c = -3.30
print(int(a), floor(b), ceil(c), fabs(c))

38 / 100

Which mode creates a new file if the file does
not exist ?

39 / 100

Recursive function is __________.

40 / 100

What will be the output of the following
Python code ?
x = ‘abcd’
for i in x:
print(i.upper())

41 / 100

What is the use of the zeros() function in
Numpy array in python ?

42 / 100

In which software development phase quality
of software is documented ?

43 / 100

In which of the following, data is stored
permanently ?

44 / 100

Which of the following software is required
to run the hardware ?

45 / 100

What is the output of the following ?
y = ‘klmn’
for i in range(len(y)):
print(y)

46 / 100

Which function is used to add an element (5)
in the list1 ?

47 / 100

Which of the following words is not a
keyword of python language ?

48 / 100

What will be the output of the following
Python code ?
from math import factorial
print(math.factorial(5))

49 / 100

In which format Binary file contains
information ?

50 / 100

Which of the following error is returned by
the given code ?
>>> f = open(“test.txt”,”w”)
>>> f.write(345)

51 / 100

What will be the output of the following
algorithm for a=5, b=8, c=6 ?
Step 1 : Start
Step 2 : Declare variables a, b and c.
Step 3 : Read variables a, b and c.
Step 4 : If a < b
If a < c
Display a is the smallest number.
Else
Display c is the smallest number.
Else
If b < c
Display b is the smallest number.
Else
Display c is the smallest number.
Step 5 : Stop

52 / 100

Which of the following error is returned when
we try to open a file in write mode which
does not exist ?

53 / 100

Which statement will move file pointer 10
bytes backward from current position ?

54 / 100

What will be the output of the following
Python code ?
from math import *
floor(11.7)

55 / 100

Which of the following are valid string
manipulation functions in Python ?

56 / 100

What will be output for the following code ?
import numpy as np
a = np.array([1,2,3,5,8])
print (a.ndim)

57 / 100

What is the output of following Python code ?
>>>print(5*(2//3))

58 / 100

Which of the following is not an advantage
of using modules ?

59 / 100

What will be the output of the following
Python code ?
example = “helle”
example.rfind(“e”)

60 / 100

(C) k ^ ^ l (D) k ^ *l
In python language, which of the following
operators is the correct option for raising k to
the power l ?

61 / 100

What will following code segment print ?
if True or True:
if False and True or False:
print(‘A’)
elif False and False or True and True:
print(‘B’)
else:
print(‘C’)
else:
print(‘D’)

62 / 100

A _____________ stores information in the
form of a stream of ASCII or unicode
characters i.e. human readable.

63 / 100

Flow charts and Algorithms are used for
__________.

64 / 100

What will be the output of the following code
snippet ?
d = {3, 4, 5}
for k in d:
print(k)

65 / 100

Choose the correct option with respect to
Python.

66 / 100

What will be the output of following
statement ?
>>>”m”+”nl”

67 / 100

What will be the output of the following
Python code ?
>>>list1 = [1, 3]
>>>list2 = list1
>>>list1[0] = 4
>>>print(list2)

68 / 100

f.read(5) will read __________ from a file (file
object ‘f’).

69 / 100

What is the datatype of x ?
import numpy as np
a=np.array([1,2,3,4])
x= a.tolist()

70 / 100

Kite/diamond symbol in flow chart is used
for __________.

71 / 100

What is a variable defined outside a function
referred to as ?

72 / 100

A _______ statement is used when a
statement is required syntactically but you do
not want any code to execute.

73 / 100

Which of the following declarations is
incorrect ?

74 / 100

To use a module in another module, you must
import it using an ________ statement.

75 / 100

Which function is used to write data in binary
mode ?

76 / 100

What will be the output of following ?
Y=[2,5J,6]
Y.sort()

77 / 100

The sequence logic will not be used while
__________.

78 / 100

What will be output for the following code ?
import numpy as np
a = np.array([[1,2,3],[0,1,4]])
print (a.size)

79 / 100

Which of the following is a valid arithmetic
operator in Python ?

80 / 100

The brain of computer system is __________.

81 / 100

What is the output of the following code ?
import numpy as np
a = np.array([1,2,3])
print(a.ndim)

82 / 100

What is the output of the following code ?
M=[‘b’ * x for x in range(4)]
print(M)

83 / 100

Python supports the creation of anonymous
functions at runtime, using a construct called
__________.

84 / 100

What is ‘f’ in the following statement ?
f=open(“Data.txt”, “r”)

85 / 100

What is the output of following code ?
import numpy as np
a = np.array([[1,2,3],[4,5,6]])
print(a.shape)

86 / 100

What is the output of the following code ?
import numpy as np
a = np.array([1,2,3,5,8])
b = np.array([0,3,4,2,1])
c = a + b
c = c*a
print (c[2])

87 / 100

What will be the output of the following
pseudo code, where & represent ANd
operation ?
Integer a, b, c
Set b = 5, a = 1
c = a & b
Print c

88 / 100

What does readlines() method return ?

89 / 100

What will be the output of the following
pseudo code ?
Integer a, b
Set a = 10, b = 5
a = a mod (a - 6)
b = b mod (b - 2)
Print a - b

90 / 100

Structured program can be broken into
__________ to assign to more than one
developer.

91 / 100

What is the output of the following code
snippet ?
print([i.lower() for i in “HELLO”])

92 / 100

__________ function returns the current
position of file pointer.

93 / 100

Which statement will return one line from a
file (file object is ‘f’) ?

94 / 100

Which of the following symbols is used to
represent output in a flow chart ?

95 / 100

Choose the correct function declaration of
fun1() so that we can execute the following
two function calls successfully.
fun1(25, 75, 55)
fun1(10, 20)

96 / 100

Which symbol is used as a flowline to connect
two blocks in a flow chart ?

97 / 100

Which of the following functions is a built-in
function in python ?

98 / 100

For performing the addition of two numbers,
which of the following symbol in a flow chart
are used ?

99 / 100

Which of the following is not a control
structure ?

100 / 100

What will be the output of the following code
snippet ?
d = {3, 4, 5}
for k in d:
print(k)

Your score is

The average score is 34%

0%

Test 3 O Level M3

1 / 100

What is the output of the following ?
y = ‘klmn’
for i in range(len(y)):
print(y)

2 / 100

Pictorial representation of an algorithm is
called as __________.

3 / 100

Which function is used to write data in binary
mode ?

4 / 100

What will be output for the following code ?
import numpy as np
a = np.array( [2, 3, 4, 5] )
print(a.dtype)

5 / 100

What type of data is : arr = [(1, 1), (2, 2),
(3, 3)] ?

6 / 100

What is the datatype of x ?
import numpy as np
a=np.array([1,2,3,4])
x= a.tolist()

7 / 100

The brain of computer system is __________.

8 / 100

Which of the following will delete key-value
pair for key=”tiger” in dictionary ?
dic={“lion”:”wild”,”tiger”:”wild”,”cat”:”domestic”,
“dog”.”domestic”}

9 / 100

What will be the output of the following
Python code ?
def power(x, y=2):
r=1
for i in range(y):
r=r*x
return r
print (power(3))
print (power(3,3))

10 / 100

What will be the output of following
statement ?
>>>”m”+”nl”

11 / 100

What will be the output of the following code
snippet ?
numbers = (4, 7, 19, 2, 89, 45, 72, 22)
sorted_numbers = sorted(numbers)
odd_numbers = [x for x in sorted_numbers if
x % 2 != 0]
print(odd_numbers)

12 / 100

What is the output of following code ?
import numpy as np
a = np.array([[1,2,3],[4,5,6]])
print(a.shape)

13 / 100

Which of the following words is not a
keyword of python language ?

14 / 100

What is the use of the zeros() function in
Numpy array in python ?

15 / 100

In python language, which of the following
operators is the correct option for raising k to
the power l ?

16 / 100

What is ‘f’ in the following statement ?
f=open(“Data.txt”, “r”)

17 / 100

Which of the following are valid string
manipulation functions in Python ?

18 / 100

In python language, which of the following
cannot be defined as variable ?

19 / 100

Which of the following declarations is
incorrect ?

20 / 100

What will be the output of the following
Python code ?
d1={“abc”:5,”def”:6,”ghi”:7}
print(d1[0])

21 / 100

Which of the following software is required
to run the hardware ?

22 / 100

Choose the correct function declaration of
fun1() so that we can execute the following
two function calls successfully.
fun1(25, 75, 55)
fun1(10, 20)

23 / 100

Python supports the creation of anonymous
functions at runtime, using a construct called
__________.

24 / 100

Which statement will move file pointer 10
bytes backward from current position ?

25 / 100

Which of the following error is returned by
the given code ?
>>> f = open(“test.txt”,”w”)
>>> f.write(345)

26 / 100

Which mode creates a new file if the file does
not exist ?

27 / 100

What will be the output of the following
Python code ?
len([“hello”,2, 4, 6])

28 / 100

Debugging is the process of fixing a
__________ in the software.

29 / 100

The sequence logic will not be used while
__________.

30 / 100

What will be the output of the following
Python code ?
tuple1=(5,1,7,6,2)
tuple1.pop(2)
print(tuple1)

31 / 100

What will be the output of the following code
snippet ?
from math import *
a = 2.19
b = 3.999999
c = -3.30
print(int(a), floor(b), ceil(c), fabs(c))

32 / 100

What will be the output of the following code
snippet ?
d = {3, 4, 5}
for k in d:
print(k)

33 / 100

Choose the correct option with respect to
Python.

34 / 100

Flow charts and Algorithms are used for
__________.

35 / 100

When we open file in append mode the file
pointer is at the _________ of the file.

36 / 100

What is the output of the following ?
n=5
while n>0:
n-=1
if n ==2:
continue
print(n)

37 / 100

Which of the following is not a control
structure ?

38 / 100

What is the value of the following Python
code ?
>>>print(36 / 4)

39 / 100

Which of the following error is returned when
we try to open a file in write mode which
does not exist ?

40 / 100

Which statement is correct to import all
modules from the package ?

41 / 100

Which of the following is a valid arithmetic
operator in Python ?

42 / 100

What will be the output of the following
Python code ?
x = ‘abcd’
for i in x:
print(i.upper())

43 / 100

Which function is used to add an element (5)
in the list1 ?

44 / 100

__________ function returns the current
position of file pointer.

45 / 100

What will be the output of the following
pseudo code, where & represent ANd
operation ?
Integer a, b, c
Set b = 5, a = 1
c = a & b
Print c

46 / 100

Which symbol is used as a flowline to connect
two blocks in a flow chart ?

47 / 100

Which translator is used to convert assembly
language into machine language ?

48 / 100

Which one of the following is immutable data
type ?

49 / 100

Which of the following symbols is used to
represent output in a flow chart ?

50 / 100

A _______ statement is used when a
statement is required syntactically but you do
not want any code to execute.

51 / 100

What will be the output of the following
Python code ?
example = “helle”
example.rfind(“e”)

52 / 100

What will be the output of the following
algorithm for a=5, b=8, c=6 ?
Step 1 : Start
Step 2 : Declare variables a, b and c.
Step 3 : Read variables a, b and c.
Step 4 : If a < b
If a < c
Display a is the smallest number.
Else
Display c is the smallest number.
Else
If b < c
Display b is the smallest number.
Else
Display c is the smallest number.
Step 5 : Stop

53 / 100

Kite/diamond symbol in flow chart is used
for __________.

54 / 100

What will be the output of following ?
Y=[2,5J,6]
Y.sort()

55 / 100

What is a variable defined outside a function
referred to as ?

56 / 100

Hierarchy in a pseudo-code can be shown
by :

57 / 100

What is the output of the following code ?
import numpy as np
a = np.array([1,2,3])
print(a.ndim)

58 / 100

Which of the following is used to define a
block of code in Python language ?

59 / 100

What will be the output of the following ?
print(sum(1,2,3))

60 / 100

Recursive function is __________.

61 / 100

What is the output of the following code
snippet ?
print([i.lower() for i in “HELLO”])

62 / 100

What will be the output of the following
Python code ?
def display(b, n):
while n>0:
print(b, end=””)
n=n-1
display(‘z’, 3)

63 / 100

What is the output of the following code ?
def s(n1):
print(n1)
n1 = n1 +2
n2=4
s(n2)
print(n2)

64 / 100

In which of the following, data is stored
permanently ?

65 / 100

What will be output for the following code ?
import numpy as np
ary = np.array([1,2,3,5,8])
ary = ary + 1
print (ary[1])

66 / 100

Which of the following functions is a built-in
function in python ?

67 / 100

What will be the output of the following
Python code ?
from math import *
floor(11.7)

68 / 100

Structured program can be broken into
__________ to assign to more than one
developer.

69 / 100

In which software development phase quality
of software is documented ?

70 / 100

Which of the following is not an advantage
of using modules ?

71 / 100

What is the output of the following ?
x=123
for i in x:
print(i)

72 / 100

What will following code segment print ?
if True or True:
if False and True or False:
print(‘A’)
elif False and False or True and True:
print(‘B’)
else:
print(‘C’)
else:
print(‘D’)

73 / 100

What will be the output of the following
Python code ?
from math import factorial
print(math.factorial(5))

74 / 100

The contents inside the “for loop” are
separated by :

75 / 100

The correct extension of the Python file is
____________.

76 / 100

What is the output of the following ?
m = 0
while m < 5:
print(m)
m += 1
if m == 3:
break
else:
print(0)

77 / 100

To use a module in another module, you must
import it using an ________ statement.

78 / 100

A detailed flow chart is called as __________.

79 / 100

Which statement will return one line from a
file (file object is ‘f’) ?

80 / 100

In which format Binary file contains
information ?

81 / 100

The connector symbol for flow chart is
__________.

82 / 100

What will be output for the following code ?
import numpy as np
a = np.array([1,2,3,5,8])
print (a.ndim)

83 / 100

f.read(5) will read __________ from a file (file
object ‘f’).

84 / 100

What is the output of the following code ?
M=[‘b’ * x for x in range(4)]
print(M)

85 / 100

What will be the output of the following
Python code ?
>>>list1 = [1, 3]
>>>list2 = list1
>>>list1[0] = 4
>>>print(list2)

86 / 100

What is the output of following Python
code ?
>>>print(5*(2//3))

87 / 100

NumPY stands for :

88 / 100

What will be the output of the following
expression ?
x = 14
print(x>>2)

89 / 100

Given a string x=”hello” What is the output
of x.count(‘l’) ?

90 / 100

What is the output of the following ?
print(max([1, 2, 3, 4], [4, 5, 6], [7]))

91 / 100

For performing the addition of two numbers,
which of the following symbol in a flow chart
are used ?

92 / 100

What is the output of the following code ?
import numpy as np
a = np.array([1,2,3,5,8])
b = np.array([0,3,4,2,1])
c = a + b
c = c*a
print (c[2])

93 / 100

What will be output for the following code ?
import numpy as np
a = np.array([[1,2,3],[0,1,4]])
print (a.size)

94 / 100

What is the output of the following code ?
a = set(‘abc’)
b = set(‘cdef’)
print(a&b)

95 / 100

What will be the output of the following
pseudo code ?
Integer a, b
Set a = 10, b = 5
a = a mod (a - 6)
b = b mod (b - 2)
Print a - b

96 / 100

A _____________ stores information in the
form of a stream of ASCII or unicode
characters i.e. human readable.

97 / 100

Python is written in __________.

98 / 100

Which of the following will read entire
content of file (file object ‘f’) ?

99 / 100

What will be the output of the following
Python code ?
def func(a, b=5, c=10):
print(‘a is’, a, ‘and b is’, b, ‘and c is’, c)
func(13, 17)
func(a=2, c=4)
func(5,7,9)

100 / 100

Which of the following is used to define a
block of code in Python language ?

Your score is

The average score is 0%

0%

Test 2 O Level M3

1 / 100

Which of the following is a valid arithmetic
operator in Python ?

2 / 100

Which statement will return one line from a
file (file object is ‘f’) ?

3 / 100

Which statement will move file pointer 10
bytes backward from current position ?

4 / 100

What will be the output of the following
Python code ?
>>>list1 = [1, 3]
>>>list2 = list1
>>>list1[0] = 4
>>>print(list2)

5 / 100

What is the output of the following code ?
import numpy as np
a = np.array([1,2,3])
print(a.ndim)

6 / 100

Which of the following words is not a
keyword of python language ?

7 / 100

What will be the output of the following
expression ?
x = 14
print(x>>2)

8 / 100

Which of the following symbols is used to
represent output in a flow chart ?

9 / 100

What will be the output of following
statement ?
>>>”m”+”nl”

10 / 100

What will be output for the following code ?
import numpy as np
a = np.array([[1,2,3],[0,1,4]])
print (a.size)

11 / 100

Which statement is correct to import all
modules from the package ?

12 / 100

A _____________ stores information in the
form of a stream of ASCII or unicode
characters i.e. human readable.

13 / 100

Which of the following is not a control
structure ?

14 / 100

What type of data is : arr = [(1, 1), (2, 2),
(3, 3)] ?

15 / 100

Choose the correct option with respect to
Python.

16 / 100

Flow charts and Algorithms are used for
__________.

17 / 100

Kite/diamond symbol in flow chart is used
for __________.

18 / 100

The contents inside the “for loop” are
separated by :

19 / 100

What will be the output of the following
Python code ?
len([“hello”,2, 4, 6])

20 / 100

What will be the output of following ?
Y=[2,5J,6]
Y.sort()

21 / 100

Which function is used to add an element (5)
in the list1 ?

22 / 100

What is ‘f’ in the following statement ?
f=open(“Data.txt”, “r”)

23 / 100

What will be the output of the following
Python code ?
def display(b, n):
while n>0:
print(b, end=””)
n=n-1
display(‘z’, 3)

24 / 100

What is the datatype of x ?
import numpy as np
a=np.array([1,2,3,4])
x= a.tolist()

25 / 100

What will be the output of the following code
snippet ?
d = {3, 4, 5}
for k in d:
print(k)

26 / 100

Which of the following will delete key-value
pair for key=”tiger” in dictionary ?
dic={“lion”:”wild”,”tiger”:”wild”,”cat”:”domestic”,
“dog”.”domestic”}

27 / 100

What will be output for the following code ?
import numpy as np
ary = np.array([1,2,3,5,8])
ary = ary + 1
print (ary[1])

28 / 100

What will be the output of the following
Python code ?
d1={“abc”:5,”def”:6,”ghi”:7}
print(d1[0])

29 / 100

What is the output of following Python
code ?
>>>print(5*(2//3))

30 / 100

What is the output of following code ?
import numpy as np
a = np.array([[1,2,3],[4,5,6]])
print(a.shape)

31 / 100

Which mode creates a new file if the file does
not exist ?

32 / 100

What is the output of the following ?
n=5
while n>0:
n-=1
if n ==2:
continue
print(n)

33 / 100

What is the output of the following code
snippet ?
print([i.lower() for i in “HELLO”])

34 / 100

Which of the following declarations is
incorrect ?

35 / 100

Recursive function is __________.

36 / 100

__________ function returns the current
position of file pointer.

37 / 100

NumPY stands for :

38 / 100

What will be the output of the following
Python code ?
tuple1=(5,1,7,6,2)
tuple1.pop(2)
print(tuple1)

39 / 100

Which of the following is not an advantage
of using modules ?

40 / 100

What is the output of the following code ?
import numpy as np
a = np.array([1,2,3,5,8])
b = np.array([0,3,4,2,1])
c = a + b
c = c*a
print (c[2])

41 / 100

Which symbol is used as a flowline to connect
two blocks in a flow chart ?

42 / 100

The connector symbol for flow chart is
__________.

43 / 100

In which of the following, data is stored
permanently ?

44 / 100

What will be the output of the following ?
print(sum(1,2,3))

45 / 100

What will be the output of the following
algorithm for a=5, b=8, c=6 ?
Step 1 : Start
Step 2 : Declare variables a, b and c.
Step 3 : Read variables a, b and c.
Step 4 : If a < b
If a < c
Display a is the smallest number.
Else
Display c is the smallest number.
Else
If b < c
Display b is the smallest number.
Else
Display c is the smallest number.
Step 5 : Stop

46 / 100

What is the output of the following code ?
def s(n1):
print(n1)
n1 = n1 +2
n2=4
s(n2)
print(n2)

47 / 100

What is the use of the zeros() function in
Numpy array in python ?

48 / 100

In which software development phase quality
of software is documented ?

49 / 100

A _______ statement is used when a
statement is required syntactically but you do
not want any code to execute.

50 / 100

In python language, which of the following
operators is the correct option for raising k to
the power l ?

51 / 100

What will be the output of the following
Python code ?

def func(a, b=5, c=10):
print(‘a is’, a, ‘and b is’, b, ‘and c is’, c)
func(13, 17)
func(a=2, c=4)
func(5,7,9)

52 / 100

Which of the following will read entire
content of file (file object ‘f’) ?

53 / 100

The brain of computer system is __________.

54 / 100

For performing the addition of two numbers,
which of the following symbol in a flow chart
are used ?

55 / 100

To use a module in another module, you must
import it using an ________ statement.

56 / 100

What is the value of the following Python
code ?
>>>print(36 / 4)

57 / 100

What will be the output of the following
Python code ?
example = “helle”
example.rfind(“e”)

58 / 100

Python is written in __________.

59 / 100

f.read(5) will read __________ from a file (file
object ‘f’).

60 / 100

What does readlines() method return ?

61 / 100

What is a variable defined outside a function
referred to as ?

62 / 100

Python supports the creation of anonymous
functions at runtime, using a construct called
__________.

63 / 100

Which of the following software is required
to run the hardware ?

64 / 100

Structured program can be broken into
__________ to assign to more than one
developer.

65 / 100

What will be the output of the following code
snippet ?
numbers = (4, 7, 19, 2, 89, 45, 72, 22)
sorted_numbers = sorted(numbers)
odd_numbers = [x for x in sorted_numbers if
x % 2 != 0]
print(odd_numbers)

66 / 100

Which of the following functions is a built-in
function in python ?

67 / 100

What is the output of the following ?
x=123
for i in x:
print(i)

68 / 100

What will be the output of the following
pseudo code, where & represent ANd
operation ?
Integer a, b, c
Set b = 5, a = 1
c = a & b
Print c

69 / 100

What will be the output of the following
pseudo code ?
Integer a, b
Set a = 10, b = 5
a = a mod (a - 6)
b = b mod (b - 2)
Print a - b

70 / 100

Which of the following error is returned when
we try to open a file in write mode which
does not exist ?

71 / 100

Which function is used to write data in binary
mode ?

72 / 100

The sequence logic will not be used while
__________.

73 / 100

What will be the output of the following
Python code ?
from math import *
floor(11.7)

74 / 100

In which format Binary file contains
information ?

75 / 100

What is the output of the following ?
print(max([1, 2, 3, 4], [4, 5, 6], [7]))

76 / 100

What will following code segment print ?
if True or True:
if False and True or False:
print(‘A’)
elif False and False or True and True:
print(‘B’)
else:
print(‘C’)
else:
print(‘D’)

77 / 100

What is the output of the following ?
y = ‘klmn’
for i in range(len(y)):
print(y)

78 / 100

Hierarchy in a pseudo-code can be shown
by :

79 / 100

What will be the output of the following
Python code ?
x = ‘abcd’
for i in x:
print(i.upper())

80 / 100

Choose the correct function declaration of
fun1() so that we can execute the following
two function calls successfully.
fun1(25, 75, 55)
fun1(10, 20)

81 / 100

In python language, which of the following
cannot be defined as variable ?

82 / 100

What will be the output of the following code
snippet ?
from math import *
a = 2.19
b = 3.999999
c = -3.30
print(int(a), floor(b), ceil(c), fabs(c))

83 / 100

What is the output of the following code ?
M=[‘b’ * x for x in range(4)]
print(M)

84 / 100

When we open file in append mode the file
pointer is at the _________ of the file.

85 / 100

Which of the following is used to define a
block of code in Python language ?

86 / 100

Which of the following are valid string
manipulation functions in Python ?

87 / 100

Which of the following error is returned by
the given code ?
>>> f = open(“test.txt”,”w”)
>>> f.write(345)

88 / 100

Which one of the following is immutable data
type ?

89 / 100

Which translator is used to convert assembly
language into machine language ?

90 / 100

What will be output for the following code ?
import numpy as np
a = np.array( [2, 3, 4, 5] )
print(a.dtype)

91 / 100

What is the output of the following ?
m = 0
while m < 5:
print(m)
m += 1
if m == 3:
break
else:
print(0)

92 / 100

Debugging is the process of fixing a
__________ in the software.

93 / 100

What will be output for the following code ?
import numpy as np
a = np.array([1,2,3,5,8])
print (a.ndim)

94 / 100

Pictorial representation of an algorithm is
called as __________.

95 / 100

The correct extension of the Python file is
____________.

96 / 100

What will be the output of the following
Python code ?
def power(x, y=2):
r=1
for i in range(y):
r=r*x
return r
print (power(3))
print (power(3,3))

97 / 100

Given a string x=”hello” What is the output
of x.count(‘l’) ?

98 / 100

A detailed flow chart is called as __________.

99 / 100

What will be the output of the following
Python code ?
from math import factorial
print(math.factorial(5))

100 / 100

Which of the following is a valid dictionary in Python?

Your score is

The average score is 0%

0%

Test 1 O Level M3

1 / 100

 What will be the datatype of the var in the below code snippet?

var-10

print(type(var))

var "Hello"

print(type(var))

2 / 100

 What does-5 evaluate to?

3 / 100

 Which of the following modules need to be imported to handle date time computations in Python?

4 / 100

. To start Python from the command prompt, use the command

5 / 100

 Which of the following functions converts date to corresponding time in Python?

6 / 100

 What is the output of the following program: print "Hello World"[::-1]

7 / 100

 Which of the following functions is a built-in function in python?

8 / 100

 Which of the following types of loops are not supported in Python?

9 / 100

 What does pip stand for python?

10 / 100

 Which of the following statements are used in Exception Handling in Python?

11 / 100

Which keyword is used for function in Python language?

12 / 100

 Which of the following concepts is not a part of Python?

13 / 100

Is Python case sensitive when dealing with identifiers?

14 / 100

How many control statements python supports?

15 / 100

In which language is Python written?

16 / 100

. Which of the following are valid string manipulation functions in Python?

17 / 100

What is the maximum possible length of an identifier?

18 / 100

 Which of the following is not a valid set operation in python?

19 / 100

Which one of the following is the correct extension of the Python file ?

20 / 100

What keyword is used in Python to raise exceptions?

21 / 100

 Which character is used in Python to make a single line comment ?

22 / 100

 What is the output of the code print (9//2)

23 / 100

What is the output of the following code: L-['a','b','c','d'] print("" join(L))

24 / 100

 Which of the following statements given below is/are true?

25 / 100

 What is the correct command to shuffle the following list?

fruit-['apple', 'banana', 'papaya', 'cherry']

26 / 100

 What will be the output of the following code snippet? a=[1,2,3,4,5,6,7,8,9]

a[::2] 10,20,30,40,50,60

print(a)

27 / 100

 How is a code block indicated in Python?

28 / 100

. How is a code block indicated in Python?

29 / 100

 How can assertions be disabled in Python? A. Passing-O when running python

30 / 100

To read all contents from file object FILE at once we may use

31 / 100

.In which format Binary file contains information

32 / 100

To open a file Myfile.txt, which is stored at d:\Myfolder, for WRITING, we can use

33 / 100

If we do not specify file mode while opening a file, the file will open in ..............mode

34 / 100

To open a file in python language................ function is used

35 / 100

Which of the following file formats are allowed to store data through python programming ?

36 / 100

How do you assign a tuple of length 1 to the variable a? (Check all that are correct.)

37 / 100

What's the main difference between Python lists and tuples?

38 / 100

What is the expression that returns the 'z' in 'baz"?

39 / 100

What will be the output of squares = {x: x*x for x in range(6)}

40 / 100

colors ["red", "green", "burnt sienna", "blue"] Which list index would select the value 'red' from the above list

41 / 100

The function used to convert to datetime is:

42 / 100

Which one of the following has the highest precedence in the expression?

43 / 100

Why does the name of local variables start with an underscore discouraged?

44 / 100

Which of the following keywords is used for function declaration in Python language?

45 / 100

Which options are correct to create an empty set in Python?

46 / 100

Which of the following function is used to find the total number of elements in a numpy array

47 / 100

for i in range (-5,0,1) will run

48 / 100

The following command is substitution when multiple ifs are used

49 / 100

Dictionary has:

50 / 100

To create sequences of numbers, Numpy provides a function range that returns arrays instead of lists analogous to

51 / 100

What is the result of round (0.5)-round(-0.5)?

52 / 100

Which is the special symbol used in python to add comments?

53 / 100

Which of the following keywords is not reversed keyword in python?

54 / 100

csv stands for

55 / 100

Which statement is correct?

56 / 100

PVM is often called

57 / 100

What will be the output of the following Python code? strl="helloworld" str1[::-1]

58 / 100

Which of the following file-modes does retains file data and append new data.

59 / 100

readlines () will return

60 / 100

What is easier for a program to read and write.

61 / 100

. What will be the output?

Def f(x,y,z): return x+y+ z

f(2,30,400)

62 / 100

What is the purpose of NumPy in Python?

63 / 100

What of the following is the use of function in python?

64 / 100

NumPy arrays can be

65 / 100

Which keyword is used for function?

66 / 100

Which of the following method creates a new array object that looks at the same data?

67 / 100

Which of the following would NOT work as a variable name?

68 / 100

Writes a list in a file.

69 / 100

Commnd to write a list in a file.

70 / 100

Which of the following function is used to write List of Strings in file ?

71 / 100

Which of the following function is used to write List of Strings in file ?

72 / 100

Which among the following statement is false?

73 / 100

Which one of the following is the right way to call a function?

74 / 100

The most important object defined in NumPy is an N-dimensional array type called?

75 / 100

Execution of statements in construct depend on a condition test

76 / 100

What error will occur when you execute the following code? MANGO - APPLE

77 / 100

What keyword would you use to add an alternative condition to an if statement?

78 / 100

NumPy stands for?

79 / 100

Which of following is not a decision-making statement

80 / 100

What will be the output of the following python code?

min (lambda x,y: x if x<y else y) min(101*99, 102*98)

81 / 100

78. What will be the output of the following Python code?

from numpy import random. xrandom.randint(100)

print(x)

82 / 100

How to import NumPy module?

83 / 100

Python uses:

84 / 100

How to import NumPy module?

85 / 100

How we install numPy in system?

86 / 100

What is the range of uint32 data type?

87 / 100

How we can change the shape of the NumPy array in python?

88 / 100

NumPy developed by?

89 / 100

What are the attributes of NumPy array?

 

90 / 100

What is fortran order in NumPy?

91 / 100

Which of the following sets the size of the buffer used in ufumes?

92 / 100

What is the output of the following Python code?

x = [1, 2, 3]
x.append(4)
print(x)

93 / 100

Which of the following is a Python set operation?

94 / 100

What does the len() function do in Python?

95 / 100

Which of the following will convert a string to a list of characters in Python?

96 / 100

Which Python keyword is used to define an anonymous function?

97 / 100

What is the output of the following Python code?

x = 10
y = 5
print(x // y)

98 / 100

Which of the following is used to handle exceptions in Python?

99 / 100

What does the break statement do in Python?

100 / 100

What is the output of the following code?

print(2 ** 3)

Your score is

The average score is 39%

0%