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) _______ is latest high level language.

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

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

print("xyyzxyzxzxyy".endswith("xyy", 0, 2))

4) Which can contain multiple lines of text.

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

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

7) Which of the following is a Python tuple?

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

a = 2.19
b=3.999999
C= -3.30
printint((a), floor(b), ceil(c), fabs(c))

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

True = False  while True:      print(True)      break

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

  l1=[1,2,3]  l2=[4,5,6]  [x*y for x in l1 for y in l2]

11) Which of the following is incorrect regarding variables in Python?

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

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

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

15) In which language is Python written?

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

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

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

18) Users write the programs in which language?

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

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

20) Python programming language was create by ______.

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

22) Which of the following declarations is incorrect in python language?

23) (

What will be the output of the following Python code?

>>> a={5,4}  >>> b={1,2,4,5}  >>> a<b

 

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


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

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

29) In python we can change the value of variable

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

31) Which of the following is not a keyword ?

32) _____ is also known as the alias array.

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

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

print("abcdef".center())

35) Which of the following is an invalid statement?

36) Suppose list1 is [3, 5, 25, 1, 3], what is min(list1)?

37) Which of the following is not a keyword?

38) Which of the following statement will be true.

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

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

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

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

43)

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

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

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

46) What will be the output of the following pseudocode, where ^ represent XOR operation ?

Integer a, b, c
set b = 4, a = 3
c =a ^ b
Print c

 

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

  x = 2  for i in range(x):      x -= 2      print (x)

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

>>>print(chr(ord('b')+1))

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

print('for'.isidentifier())

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

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

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

>>> a.sort()

>>> a

52) Is it safe to directly use the == operator to determine whether objects of type float are equal ?

53) Is the following Python code valid?

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

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

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

myList = [1, 2, 3, 4, 5, 6]
for i in range(1, 6):
    myList[i - 1] = myList[i]     
for i in range(0, 6): 
    print(myList[i], end = " ")

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

  a=["Apple","Ball","Cobra"]  <br class="blank" />a.sort(key=len)  print(a)

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

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

59) What will be the output of the following Python code, if s1= {1, 2, 3}?

s1.issubset(s1)

60) Which of the following will give error ?

61) An empty/null statement in Python is

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

  num = ['One', 'Two', 'Three']  for i, x in enumerate(num):      print('{}: {}'.format(i, x),end=" ")

63) Python converts the source code into an intermediate form called _______.

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

65) Which of the following functions cannot be used on heterogeneous sets?

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

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

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

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

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

71) What will be the result of the expression 15 and 10?

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

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

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

74) Algorithm when transalated into a programming language is called

75)

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

77) When _____ gets executed, 'inner PI value' is printed as that is 'pi' value inside the function namespace.

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

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

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

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

81) Tool ________ is used for program design.

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

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

>>> {x*2 for x in a|{4,5}}

83) Python converts numbers internally in an expression containing mixed types to a Common type for evaluation. But sometimes, coerce a number explicitly from one type to another to satisfy the requirements of ____ parameter.

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

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

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)
What is the output of the code print(7%2).

87) The operator used to check if both the operands reference the same object memory, is the .......... operator.

88) In computer science, refers to a special method usable by a computer for the solution to a problem.

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

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

91) The _____ statement is used for exiting from the loop.

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

print("xyyzxyzxzxyy".count('yy'))

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

94)

95) An algorithm is best describe as

96) If we have two sets, s1 and s2, and we want to check if all the elements of s1 are present in s2 or not, we can use the function:

97) Function range(0, 5, 2) will yield on iterable sequence like

98) The operator returns the quotent after division.

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

print(4.00/(2.0+2.0))

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

Your score is

You cannot copy content of this page