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) What will be the output of the following Python code?

>>> s={5,6}  >>> s*3

2) What will be the output of the following Python code snipped if x = 1?

x<<2

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

4) A natural number 1 is also an ____ .

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

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

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

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

print("abcdef".find("cd"))

9) Which of the following is the use of id() function in python?

10) Suppose listExample is [‘h’,’e’,’l’,’l’,’o’], what is len(listExample)?

11) A program which translate a high-level language program into a machine language program is called

12) Set makes use of __________ Dictionary makes use of ____________

13) Is the following Python code valid?

>>> a=(1,2,3)  >>> b=a.update(4,)

14) How many numbers will be printed by the following code?

def fun(a,b):
    for x in range(a,b+1):
        if x%3==0:
            print(x,end=" ")
fun(100,120)

15) Is the following Python code valid?

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

16) _____ reads one entire line from the file.

17) All keywords in python are in ____

18) Empty list indicated by which symbol.

19) What is the output of the following ?

print(int())
20)
A natural number 1 is also an ______.


22) The output of this code is ______ .

23) What is the output of the following code?

a=set('abc')
b=set('cdef')
print(a&b)

24) Is the following Python code valid?

    a={3,4,{7,5}}  print(a[2][0])

25) To use a module in another module, you must import it using an, statement

26) An algorithm that calls itself directly or indirectly is known as

27) Which of the following software translates source code into object code ?

28) ____ is a function of dictionary gets all the values from the dictionary.

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

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

  d = {0: 'a', 1: 'b', 2: 'c'}  for x, y in d.items():      print(x, y)

31) The program must be able to handle unexpected situation like wrong input or no input.

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

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

  z=set('abc$de')  'a' in z

34) An algorithm that calls itself directly or indirectly is called as

35) The operator used to calculate remainder after division.

36) List structure in python where elements are stored in _______ parenthesis.

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

matrix = [[1, 2, 3, 4],
         [4, 5, 6, 7],
         [8, 9, 10, 11],
         [12, 13, 14, 15]]  
for i in range(0, 4):
      print(matrix[i][1], end = " ")

39) ___ in Python is a counter-controlled loop.

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

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

for i in '':      print (i)

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

44)

45) The symbol used for conditional statement n a flow chart is a ____

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

a=[13,56,17]
a.append([87])
a.extend([45,67])
print(a)

48) What is the output of the following code?

list1=[2, 33, 222, 14, 25]
print(list1[ : -1 ])

49) Which of the following defines what an object can do?

50) Which function is used to Evaluates string and returns an object.

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

for i in range(10):      if i == 5:          break      else:          print(i)  else:      print("Here")

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

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

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

>>> a

53) If list1=[10,20,30], then operation list1*2 returns ____ .

54) Read the information given below carefully and write a list comprehension such that the output is: [‘e’, ‘o’]

  w="hello"  v=('a', 'e', 'i', 'o', 'u')

55) You can obtain a value in a ______using a key for a single element.

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

57) are set of procedures defined in library to find the minimum value function or the root of an equation.

58) Why are local variable names beginning with an underscore discouraged?

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

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

60) Which one of the following is the correct extension of the Python file-

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

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

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

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

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

65) The _____ function converts the specified value into a string.

66) What is the value of the expression 10 + 3 ** 3 * 2?

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

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

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

  1. >>>my_tuple = (1, 2, 3, 4)
  2. >>>my_tuple.append( (5, 6, 7) )
  3. >>>print len(my_tuple)

69) Algorithms cannot be represented by____

70) The brain of computer system is

71) To which of the following the “in” operator can be used to check if an item is in it ?

72) The process of finding errors in code is called as

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

print([i.lower() for i in "HELLO"])

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

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

76) Which of these about a frozenset is not true?

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

Integer a
Set a =4
do
	print a + 2
      a = a-1
while (a not equals 0)
end while

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

  a = [1, 5, 7, 9, 9, 1]  <br class="blank" />b=a[0]  <br class="blank" />x= 0  for x in range(1, len(a)):      if a[x] > b:          b = a[x]          b= x  print(b)

79) Write a list comprehension to produce the list: [1, 2, 4, 8, 16……212].

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

  s=["pune", "mumbai", "delhi"]  [(w.upper(), len(w)) for w in s]

81) What is the output of the following program :
Loading question image..Pls wait.

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

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

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

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

>>> b=a.add(4)

>>> b

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

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

  1. >>>t=(1,2,4,3)
  2. >>>t[1:3]

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

87) What is the return value of trunc()?

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

s={1, 2, 3}

    s.update(4) 
s

89) What is the syntax of the following Python code?

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

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

  A = [[1, 2, 3],       [4, 5, 6],       [7, 8, 9]]     [[col + 10 for col in row] for row in A]

91) The functions which are coming with Python software automatically are called ____ .

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

  d = {0: 'a', 1: 'b', 2: 'c'}  for x in d.values():      print(x)

93) The method used to removes all the items at once.

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

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

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

  d = {0: 'a', 1: 'b', 2: 'c'}  for i in d:      print(i)

 

97) Which of the following is a floor division operator?

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

>>> a=(2,3,4)  >>> sum(a,3)

99) An algorithm is best describe as

100) Write the list comprehension to pick out only negative integers from a given list ‘l’.

Your score is

You cannot copy content of this page