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?

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

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

3) The brain of computer system is

4) In which datatype we can store True/False type values

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


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

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

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

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

11) What type of data is: a=[(1,1),(2,4),(3,9)]?

12) Which inbuilt function is used to takes an iterable object as input and makes them immutable.

13) The write method returns ________.

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

15) Select the reserved keyword in python.

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

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

17) The Compexity of linear search algorithm is

18) The function that yields current position in the file

19) If we not see the rules of th programming language, we get ?

20) Python myfile.py is used to ____ file in command shell.

21) A detailed flow chart is called as______?

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

  l=["good", "oh!", "excellent!", "#450"]  [n for n in l if n.isalpha() or n.isdigit()]

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

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

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

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

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

27) What will be the output of the following Python statement?(python 3.xx)

  1. >>>print(format("Welcome", "10s"), end = '#')
  2. >>>print(format(111, "4d"), end = '#')
  3. >>>print(format(924.656, "3.2f"))

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

29) Which method is used to Write(s) a list of lines to the file.

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

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

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

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

33) Which symbol is used to write single line comment ?

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

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

36) What is the current syntax of remove() a file ?

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

print('*', "abcdef".center(7), '*', sep='')

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

39) Write a list comprehension for number and its cube for l=[1, 2, 3, 4, 5, 6, 7, 8, 9].

40) If a={5,6,7}, what happens when a.add(5) is executed?

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

def m(list):
    v = list[0]
    for e in list:
        if v < e:
            v = e
    return v
   
values = [[3, 4, 5, 1], [33, 6, 1, 2]]   
for row in values: 
      print(m(row), end = " ")

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

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

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

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

  x = 2  for i in range(x):      x += 1      print (x)

46) Is the following Python code valid?

>>> a=2,3,4,5  >>> a

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

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

 

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

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

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

50) Which of the following expression is correct.


51)

What will be the output of the following Python code?

>>> a=("Check")*3  >>> a

52) Which of the following is correct to Identify the right way to close a file.

53) ____ operator repeats a list for the given number of items.

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

55) Which of the following is not a Keyword in Python ?

56) What will be the output of the following Python code

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

(A) a is 13 and b is 15 and c is 10      a is 2 and b is 5 and c is 4      a is 5 and b is 7 and c is 9 (B) a is 13 and b is 17 and cis 10      a is 2 and b is 4 and c is 4      a is 5 and b is 9 and c is 7 (C) a is 13 and b is 17 and c is 10       a is 2 and b is 5 and cis 4       a is 5 and b is 7 and c is 9 (D) None of the above

57) Flowchart and algorithms are used for

58) What is the value of the expression 100 / 25 ?

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

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

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

print('1.1'.isnumeric())

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

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

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

print([if i%2==0: i; else: i+1; for i in range(4)])

 

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

True = False  while True:      print(True)      break

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

67) In Python, ________ is not supported.

68) Which of the following is an invalid variable?

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

>>> a={5,6,7,8}  >>> b={7,8,10,11}  >>> a^b

70) To shuffle the list(say list1) what function do we use?

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

x<<2

72) _____method calls the built-in Python help system.

73) The error that can be pointed out by the compiler are

74) Suppose list1 is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after list1.reverse()?

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

print('0xa'.isdigit())

76) The Python prompt indicates that Interpreter is ready to accept instruction.

77)

78) NumPY stands for. -

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

>>> a=(1,2,(4,5))  >>> b=(1,2,(3,4))  >>> a<b

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

print([i+j for i in "abc" for j in "def"])

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

string = "my name is x"  for i in string.split():      print (i, end=", ")

82) Is the following Python code valid?

>>> a=(1,2,3)  >>> b=('A','B','C')  >>> c=zip(a,b)

83) To insert 5 to the third position in list1, we use which command?

84) filter() is used to

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

>>> a=[(2,4),(1,2),(3,9)]  >>> a.sort()  >>> a

 

86) What signifies the end of a statement block or suite in Python ?

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

88) Which amongst this is not a jump statement ?

89) _____function takes a list of lines to be written to file.

90) ____ help to check the data type of an array-

91) Row data assigned to a variable is called as.

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

>>> a=(0,1,2,3,4)  >>> b=slice(0,2)  >>> a[b]

 

93) Which of the following is correct about Python

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

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

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

print("abcdef".center(10, '12'))

96) What will be the output of the following Python expression if x=22.19?

print("%5.2f"%x)

97) The correct extension of the Python file is

98) Kite/diamond symbol in flow chart is used for_______

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

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

 

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

Your score is

You cannot copy content of this page