Skip to content

Programming and Problem Solving through Python (M3-R5.1)- NIELIT O Level

  • by

You Have 2 hours To Complete The Test / Quiz


Programming and Problem Solving through Python (M3-R5.1)

Total available questions is More than 1000.

Each exam has 100 questions & Answers randomly.

You will get 2 hrs to complete the test.

Its Mandatory To Fill For Get Certificate After Complete Exam.

1) Which among the following list of operators has the highest precedence?

+, -, **, %, /, <<, >>, |

 

2) Suppose list1 is [4, 2, 2, 4, 5, 2, 1, 0], Which of the following is correct syntax for slicing operation?

3) Which can be an Identifier among them in Python ?

4) Which language is derived from many other language, including ABC, Modula- 3, C, C++, Algol-68, SmallTalk, and Unix shell and other scripting languages.

5) Shape() function in Numpy array is used to

6) What will be the output of the following Python code?

data = [[[1, 2], [3, 4]], [[5, 6], [7, 8]]]
def ttt(m):
    v = m[0][0]
    for row in m:
        for element in row:
            if v < element: v = element     
        return v
print(ttt(data[0]))

7) Write a list comprehension equivalent for the Python code shown below.

for i in range(1, 101):  	if int(i*0.5)==i*0.5:  		print(i)

8) All keywords in python are in ____

9) Which of the following precedence order is correct in Python?

10) ______ are the modes of both writing and reading in binary format in file.

11) _____ help programmers to create lists in a concise way.

12) What will be the output of the following Python code?

>>> a={1,2,3}

>>> a.intersection_update({2,3,4,5})

>>> a

13) What will be the output of the following Python code?

lst=[3,4,6,1,2]
lst[1:2]=[7,8]
print(lst)

14) An empty / null statement in Python is _____ .

15) Suppose list1 is [1, 3, 2], What is list1 * 2?

16) What will be the output of the following Python code?

print('a B'.isalpha())

17) What will be the output of the following pseudo code?

integer a,b
set a=9,b=5
a=a mod(a-3)
b=b mod(b-3)
print a+b

18) Which function is used to get the Data Type of any value?

19) The Pandas ______ method returns a new Data Prame.

20) _____ help programmers to create lists in a concise way.

21) What will be the output of the following Python code snippet?

  x = 'abcd'  for i in range(len(x)):      i.upper()  print (x)

22) What will be the output of the following Python code?

[ord(ch) for ch in 'abc']

23) What will be the value of the following Python expression?

4+2**5//10

25)

26) Which of the following symbol is used for input and output operations in a flow chart?

27) Python is a/an _________ language.

28) What will be the output of the following Python code snippet?

print(''.isdigit())

29) Which of the following function convert a sequence of tuples to dictionary in python?

30) Is the following Python code valid?

a={1,2,3}

b={1,2,3,4}

c=a.issuperset(b)

print(c)

31) Which of the following environment variable for Python tells the Python interpreter where to locate the module files imported into a program ?

32) In a flowchart a calculation (process) is represented by

33) The ______ mode of Python gives instant result of typed statement

34) What will be the output of the following Python code?

print("xyyzxyzxzxyy".endswith("xyy"))

35) What is the data type of (1)?

36) What will be the output after the following statements?

for i in range(1,6):
    print(i, end='')
    if i == 3:
        break

37) _____ reports all error with line numbers and produce faster object code then interpreter.

38) What will be the output of the following Python statement?

>>>"a"+"bc"

39) Which of the following is the same as list(map(lambda x: x**-1, [1, 2, 3]))?

40) What will be the output of the following Python code?

>>> a={1,2,3}

>>> b=a.copy()  >>> b.add(4)

>>> a

41) The complexity of linear search algorithm is

42) What will be the output of the following Python code?

= [5,5,6,7,7,7]

  b = set(a)  def test(lst):      if lst in b:          return 1      else:          return 0  for i in  filter(test, a):

print(i,end=" ")

43) What will be the output of the following Python code?

>>> a=(2,3,1,5)

>>> a.sort()

>>> a

44) Set of statements is executed again and again based upon conditional test.

45) What will be the output of the following Python code?

  A = [[1, 2, 3],       [4, 5, 6],       [7, 8, 9]]  B = [[3, 3, 3],

46) What will be the output of the following Python code?

print("ab\tcd\tef".expandtabs())

47) What will be the output of the following Python code?

  x = "abcdef"  i = "a"  while i in x:      x = x[:-1]      print(i, end = " ")

48) Which of the following environment variable for Python tells the Python interpreter where to locate the module files imported into a program?

49) What will be the output of the following Python code?

values = [[3, 4, 5, 1], [33, 6, 1, 2]]
v = values[0][0]
for row in range(0, len(values)):
    for column in range(0, len(values[row])):
        if v < values[row][column]:
            v = values[row][column]
print(v)

51) _____ reports all error with line numbers and produce faster object code then interpreter.

52) What is the default value of encoding in encode()?

53) Is the following Python code valid?

>>> a=frozenset([5,6,7])

>>> a

>>> a.add(5)

54) _____ is also known as the alias array.

55) Which of the following mode will refer to binary data ?

56) What is the output of >>>float('12.6')

57) The expression _____ implies that the variable x is converted to integer.

58) What will be the output of the following Python code?

= 5

while True:      if i%0O9 == 0:          break      print(i)

 

59) _____ symbols are used to connect one box of flow chart to another.

60) What arithmetic operators cannot be used with strings?

61) What is identity array?

62) What will be the output of the following Python code snippet?

  a = [0, 1, 2, 3]  for a[-1] in a:      print(a[-1])

64) What will be the output of the following Python expression if the value of x is 34?

print(“%f”%x)

65) Is the following Python code valid?

>>> a=(1,2,3,4)  >>> del a

66) What will be the output of the following Python code?

x = ['ab', 'cd']
for i in x:
    i.upper() 
print(x)

67) The operator returns the quotent after division.

68) _____ returns the current time instant, a floating-point number of seconds since the epoch.

69) The datatype whose representation is known are called

70) For two objects x and y, the expression x is y will yield True, if and only if

71) A sentinel-controlled loop can be implemented using _____

72) What will be the output of the following Python code?

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

73)

74) When an algorithm is written in the form of a programming language it becomes a

75) A process is expressed in a flowchart by

76) Which module is to be imported for using randint() function?

77) Python converts the source code into an intermediate form called ____ .

78) Which of the following is not valid Python identifiers?

79) How is a function declared in Python?

80) What will be the output of the following Python code?

>>> import collections  >>> a=collections.namedtuple('a',['i','j'])  >>> obj=a(i=4,j=7)  >>> obj

81) What will be the output of the following Python code?

s={2, 5, 6, 6, 7}

s

82) What is called when a function is defined inside a class?

83) Which of the following carries out the instructions defined in the interface ?

84) What will be the output of the following Python code?

>>> a={5,6,7,8}

>>> b={7,8,9,10}

>>> len(a+b)

85) What will be the output of the following Python code?

print("ab\tcd\tef".expandtabs('+'))
86)

87) Which of the following is correct in respect of advantages of functions ?

88) The operator used to calculate remainder after division.

89) List structure in python where elements are stored in parenthesis.

90) In flowchart, parallelogram is used to show

91) In Python, which of the following will create a block in a compound statement ?

92) NumPY stands for. -

93) What will following code segment print?

a=True
b=False
c=False
if not a or b:
	print(1)
elif not a or not b and c:
	print(2)
elif not a or b or not b and a:
	print(3)
else:
	print(4)

94) Which of the following operator in python evaluates to true if the variables on either side of the operator point to the same object and false otherwise?

95) What will be the output of the following Python code?

print("abcdef".center(7, 1))

96) What will be the output of the following Python expression?

24//6%3, 24//4//2

97) A graphical representation of a computer program in relation to its sequence of functions____ .

98)

99) Which of the following is not a keyword in Python

100) The part of a machine level instruction, which tells the central processor what has to be done, is

Your score is

You cannot copy content of this page