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?

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

2) What will be the value of p when p= int(17/2+11.5)?

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

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

 

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

z=set(‘abc’)

  z.add('san')  z.update(set(['p', 'q']))

z

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

for i in range(int(float('inf'))):      print (i)

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

7) Which of the following is an invalid statement in python.


9) 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)

10) 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)

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

13) To print the value of a variable, Python uses

14) Can we write if / else into one line in python?

15) 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)

16) Which of the following character is used to give comments in Python Program ?

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

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

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

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

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

for i in [1, 2, 3, 4][::-1]:      print (i)

20) Which of the following is an invalid variable?

21) Tool ________ is used for program design.

22) What is the output of the following code?

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

23) Connectors used to connect flowchart symbols to each other are classified as.

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

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

True = False  while True:      print(True)      break

26) ______ in the flowchart is made at the connecting point marked.

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

>>> a={4,5,6}  >>> b={2,8,6}  >>> a+b

28) Which of the following statement(s) will terminate the whole loop and proceed to the statement following the loop ?

29) When ______ gets executed, ‘inner PI value’ is printed as that is ‘pi’ value inside the function namespace.

30) What will be the output of the “hello” +1+2+3?

31) What is the output when we execute list(“hello”)?

33) The datatype whose representation is unknown are called

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

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

print('{a}{b}{a}'.format(a='hello', b='world'))

36) 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

37) Numpy was developed by___ .

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

for i in range(float('inf')):      print (i)

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

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

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

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

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

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

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

>>> a

43) Negative count from the Right.

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

  i = 1  while False:      if i%2 == 0:          break      print(i)      i += 2

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

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

46) Which of the following statement is correct about Getcwd() .

47) 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=” “)

48) The readlines() method reads and returns ______ .

49)

50) 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))
(A)  212       32 (B) 9      27 (C) 567       98 (D) None of the above

51) Designing the problem in known as

52) Which of the following will give error ?

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

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

 

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

55) A step by step method for solving a problem using English Language

56) _______ help programmers to create lists in a concise way.

57) In which year was the Python 3.0 version developed?

58) Python code can run on variety of plateforms, it means Python is a _____language.

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

60) Two main measures for the efficiency of an algorithm are

61) Which of the following is an escape sequence for a new line character

62) Which of the following is not a keyword ?

63) Every function has an implicit statement _____ as the last instruction in the function body.

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

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

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

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

66) The GCD of the numbers 136 and 170 is ______ .

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

example = "helle"
print(example.rfind("e"))

68) Empty list indicated by which symbol.

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

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

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

71) Is the following Python code valid?

a={1,2,3}

b={1,2,3,4}

c=a.issuperset(b)

print(c)

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

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

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

74) Which of the following statement prints helloexample test.txt?

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

76) 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]))

77) What is the maximum possible length of an identifier for better redability? -

78) What is use of seek() method in files?

79) will return the mathematical number PI from the constants module.

80) _______ is latest high level language.

81) Which of the following is not a legal integer type value in python.

82) Select the reserved keyword in python.

83) Every function has an implicit statement _____ as the last instruction in the function body.

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

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

85) Istrip() method is used for :

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

for i in '':      print (i)

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

print('my_string'.isidentifier())

88)

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

90) Flowchart and algorithms are used for

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

 word1="Apple"
word2="Apple"
list1=[1,2,3]
list2=[1,2,3]
print(word1 is word2)
print(list1 is list2)

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

93) What will be the result of the expression 5 and 10?

94) Which of the following refers to mathematical function?

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

list1 = [1, 3]
list2 = list1
list1[0] = 4
print(list2)

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

a = 0
b = 3
while a + b < 8:
       a += 1
       print(a, end='')

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

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

98) Testing is known as

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

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

 

100) Find the invalid variable among the following:

Your score is

You cannot copy content of this page