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) Suppose list1 is [4, 2, 2, 4, 5, 2, 1, 0], Which of the following is correct syntax for slicing operation?

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

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

  A = [[1, 2, 3],       [4, 5, 6],       [7, 8, 9]]  [A[i][len(A)-1-i] for i in range(len(A))]

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

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

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

a=[10,23,56,[78]]
b=list(a)
a[3][0]=95
a[1]=34
print(b)

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

points = [[1, 2], [3, 1.5], [0.5, 0.5]]
points.sort()
print(points)

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

  x = "abcdef"  i = "a"  while i in x:      print('i', end = " ")

8) Suppose list1 is [3, 4, 5, 20, 5], what is list1.index(5)?

9) What is the output of >>>float(‘12.6’)

10) The complexity of linear search algorithm is

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

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

12)

13) What will be the output of the following Python code ?
Loading question image..Pls wait.

14) What is the list comprehension equivalent for: list(map(lambda x:x**-1, [1, 2, 3]))?

15) Part of an algorithm which is repeated for fixed number of times is classified as

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

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

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

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

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

  1. >>>example = "helle"
  2. >>>example.find("e")

19) Find the last element of list in Python? Assume ‘bikes’ is the name of list.

20) Given a function that does not return any value, what value is shown when executed at the shell ?

21) Operations to be repeated a certain number of times are done by

22) Which of the following expressions results in an error?

23) Which of the following is not a valid identifier?

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

25) In which year was the Python language developed?

26) The output of this expression, >>>6*1**3 is ____ .

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

print('a@ 1,'.islower())

28) The ______ can be accessed only inside the function in which they are declared, whereas global variables can be accessed throughout the program body by all functions.

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

names = ['Amir', 'Bear', 'Charlton', 'Daman']
print(names[-1][-1])

30)

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

32) elif can be considered to be abbreviation of

33) Leading white space at the beginning of each element, which is used to determine the group of statement

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

35) Which one of the following has the same precedence level?

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

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

 

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

print('ab,12'.isalnum())

38) If we overcome the rules of the programming language, we get

39) ______ is used for efficient operation on homogeneous data that are stored in arrays.

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

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

42) _______ is latest high level language.

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

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

>>> a.sort()

>>> a

44) Function blocks begin with the keyword _.

45) Which of the following statement(s) will terminate only the current pass of the loop and proceed with the next iteration of the loop?

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

print('0xa'.isdigit())

47) Method is used to display entire contents of the file.

48) By using function _____ ,we can change the shape of the Numpy array in python.

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

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

50) It defines the accessibility and the lifetime of a variable.

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

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

print('Hello!2@#World'.istitle())

 

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

  1. >>>t1 = (1, 2, 4, 3)
  2. >>>t2 = (1, 2, 3, 4)
  3. >>>t1 < t2

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

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

55) Which of the following is the use of function in python ?
Loading question image..Pls wait.

56) What is the output of >>>float(‘12.6’)

57) Is the following Python code valid?

>>> a,b=1,2,3

58) NumPY stands for. –

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

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

>>> b=a.add(4)

>>> b

60) To remove string “hello” from list1, we use which command?

61) ____ is the output you get when ‘2’==2 is executed

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

for i in 'abcd'[::-1]:      print (i)

63) The data type of an expression int(m)/int(n) will result in:

64) Which of the following functions will return the symmetric difference between two sets, x and y?

65) Is the following Python code valid?

a={1,2,3}

b={1,2,3,4}

c=a.issuperset(b)

print(c)

66) What function do you use to read a string?

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

  x = (i for i in range(3))  for i in x:      print(i)  for i in x:      print(i)

68) In the Python statement x = a + 5 – b : a and b are

69) ____is a string literal denoted by triple quotes for providing the specifications of certain program elements.

70) Which of the following is correct about Python

71) Which of the following Boolean expressions is not logically equivalent to the other three?

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

values = [[3, 4, 5, 1], [33, 6, 1, 2]]
v = values[0][0]
for lst in values:
    for element in lst:
        if v > element:
            v = element
print(v)

73) Which one is the type of algorithm:

74) Which of the following Python statements will result in the output: 6?

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

75) What is the symbol used to represent start and stop of a flowchart ?

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

77) What arithmetic operators cannot be used with strings?

78) The write method returns ________.

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

print("abcdef".center())

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

  1. >>>str1="helloworld"
  2. >>>str1[::-1]

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

print("Hello {0} and {1}".format(('foo', 'bin')))

82) Which of the following is not a relational opeartor in Python?

83) Which of the following environment variable for Python is an alternative module search path ?

84) What is the return type of function id?

85) The ______ statement lets the program go through the piece of code without performing any action.

86) A program that convert a high-level language program to a set of instructions that can run on a computer is called a

87) Function range(10, 5, 2) will yield an iterable sequence like

88) Identify the correct sequence of steps to run a program.

89) What will be the output of the following Python expression if x=56.236?

print(“%.2f”%x)

90) What will be the output of the following Python expression if x=456?

print(“%-06d”%x)

91) Python is ________ Programming Language

92) Istrip() method is used for :

93) What will be the output of the following expression ?

x =4
print(x<<2)

 

94)

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

for i in range(2.0):      print(i)

96) In Python, ________ is not supported.

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

def f(values):
    values[0] = 44
   
v = [1, 2, 3]
f(v)
print(v)

98) What is the answer to this expression, 22 % 3 is?

99) A sequence of instruction, in a computer language, to get the desired result is known as

100)
_______ is a group of characters.

Your score is

You cannot copy content of this page