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?

print('ab'.isalpha())

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

  x = [i**+1 for i in range(3)]; print(x);

3) In Python, _____ defines a block of statements.

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

  a = [0, 1, 2, 3]  for a[-1] in a:      print(a[-1])

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

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

6) Which amongst this is not a jump statement ?

7) In Python, we can use _______ operators for list objects.

9) Which one of the following is a valid Python if statement:

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

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

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

12) Strings in Python are _____

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

14) An algorithm is best describe as

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

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

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

>>> a

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

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

17) Which of the following is not a keyword ?

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

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

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

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

20) _____ reads one entire line from the file.

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

  A = [[1, 2, 3],       [4, 5, 6],       [7, 8, 9]]  B = [[3, 3, 3],       [4, 4, 4],       [5, 5, 5]]  [B[row][col]*A[row][col] for row in range(3) for col in range(3)]

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

>>> a,b=6,7  >>> a,b=b,a  >>> a,b

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

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

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

25)

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

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

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

print(“%5.2f”%x)

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

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

z=set(‘abc’)

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

z

32) Which of the following will give error ?

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

34) How can we create on empty list in Python?

35) Select the reserved keyword in python.

36) in python a variable named ‘num’ ,which type of value we can store in this variable

37) Python operator always yields the result of

38) 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')

39)

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

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

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

43) Function range(3) will yield an iteratable sequence like

44) Which one of the following is a valid Python if statement:

45) Which type of Programming does Python support?

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

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

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

 

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

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

49) Which of the following statement is false about recursion:

50) What is the maximum possible length of an identifier for better redability? –

51) The differences between tuples and lists are, the tuples cannot be changed unlike lists and tuples use whereas lists use square brackets.

52) What is the data type of (1)?

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

54) What is the output of the following code?

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

55) Python programming language was create by ______.

56) If the program executed as individual program then the value of this variable is ______.

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

58) Find the invalid variable among the following:

59) Algorithms cannot be represented by____

60)

61) Which of the following is correct about Python

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

63) What will be the output of the following Python expression if the value of x is 34?

print(“%f”%x)

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

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

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

  l1=[10, 20, 30]  l2=[-10, -20, -30]  l3=[x+y for x, y in zip(l1, l2)]  l3

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

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

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

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

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

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

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

71) Flowchart and algorithms are used for

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

myList = [1, 5, 5, 5, 5, 1]
max = myList[0]
indexOfMax = 0
for i in range(1, len(myList)):
    if myList[i] > max:
        max = myList[i]
        indexOfMax = i   
print(indexOfMax)

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

>>> a={5,6,7,8}

>>> b={7,8,9,10}

>>> len(a+b)

74) What will be displayed by print(ord(‘b’) – ord(‘a’))?

75) The function used to find power of a number.

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

77) Which language is derived from many other language, including ABC, Modula- 3, C, C++, Algol-68, SmallTalk, and Unix shell and other scripting languages.

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

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

79) The function generates sequence of numbers from 1 to n.

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

81) Which of the following statements is used to create an empty set?

82)

83) Suppose list1 is [2, 33, 222, 14, 25], What is list1[-1]?

84) Converts a list into tuple.

85) What will be the output of the following algorithm for a=5, b-8, c=6 ?

Step 1: Start
Step 2: Declare variables a, b and c.
Step 3 Read variables a, b and c.
Step 4: If a < b
If a 

86) Operators with the same precedence are evaluated in which manner?

87) In which year was the Python language developed?

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

89) which function do you use to read a string?

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

91) print(0xA + 0xB + 0xC):

92) A loop block in python starts with a.. -

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

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

list1 = [11, 2, 23]
list2 = [11, 2, 2]

96) Which function is used to Writes the string(s) to the file and returns the number of characters written.

97) Suppose i is 5 and j is 4, i + j is same as ________

98) The offset of the local DST time zone.

99) A Python tuple that is created without using the parentheses brackets () is called as ?

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

Your score is

You cannot copy content of this page