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 snippet?

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

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


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

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

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

print("xyyzxyzxzxyy".endswith("xyy"))

7) If the else statement is used with a while loop, the else statement is executed when the condition becomes _____ .

8) What will following code segment print?

a=True
b=False
c=False
if not a or b:
	print(1)
elif not a or not b and c:
	print(2)
elif not a or b or not b and a:
	print(3)
else:
	print(4)

9) Which of the following variable declaration is incorrect?

10) Strings in Python are _____

11) If a is declared as a=[‘me’, ‘he’, ‘they’], the value of a=””.join(a) print(a) will be ______ .

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

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

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

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

14) Which term describes a loop that continues repeating without a terminating (ending) condition ?

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

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

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

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

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

19) Is Python case sensitive when dealing with identifiers?

20)

21) The offset of the local DST time zone.

22) Which function is used to converts and returns the binary equivalent string of a given integer.


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

  l=[1,2,3,4,5]  [x&1 for x in l]

25) The write method returns ________.

26) It defines the accessibility and the lifetime of a variable.

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

28) By using function _____ ,we can change the shape of the Numpy array in python.

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

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

 

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

import math  [str(round(math.pi)) for i in range (1, 6)]

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

      k = [print(i) for i in my_string if i not in "aeiou"]

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

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

33) is used for data analysis and manipulations in tabular data in Python.

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

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

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

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

37) What will be the output of the following Python expression if x=56.236?

print(“%.2f”%x)

38) Which mode Opens a file for both reading and writing in binary format.

39) The ______ statement lets the program go through the piece of code without performing any action.

40) What is the symbol used to represent start and stop of a flowchart?

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

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

42) Flowchart and algorithms are used for

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

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

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

45) In which year was the Python language developed?

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

print(“%5.2f”%x)

47) The expression _____ implies that the variable x is converted to integer.

48) The Compexity of linear search algorithm is

49)


50)

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

print('Hello World'.istitle())

51) All parameters (arguments) in the Python language are passed by.

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

54) ……….design approach starts by dividing the complex algorithm into one or more modules.

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

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

56) Which of the following is an invalid variable?

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

a = { 1 : “A”, 2 : “B”, 3 : “C” }

for i in a:

print (i, end=” “)

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

59) Which of the following data types is not supported in python?

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

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

print('11'.isnumeric())

62) The operator used for concatenating two strings. –

63) ______ method parses the expression passed to it and runs python expression(code) within the program.

64) 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:

65) Error does not fall into any category

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

>>> a={3,4,5}  >>> b={5,6,7}  >>> a|b

67) Is the following Python code valid?

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

68) Which of the following expressions results in an error?

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

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

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

72) Which of the following function of dictionary gets all the keys from the dictionary?

73) _____is a Pandas function for loading CSV files into Dataframe.

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

>>>list("a#b#c#d".split('#'))

75) Is the following Python code valid?

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

>>> a

>>> a.add(5)

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

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

77) The operator returns the quotent after division.

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

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

24//6%3, 24//4//2

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

print("xyyzxyzxzxyy".count('xyy', -10, -1))

81) What does the following code print ?

if 2 + 5 == 8:
    print("TRUE")
else:
    print("FALSE")
print("TRUE")

82) What will be the output of following statement ?

>>>"m"+"nl"

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

  x = 123  for i in x:      print(i)

84) Algorithms cannot be represented by____

85) Identify the correct sequence of steps to run a program.

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

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

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

 

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

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

print('HelloWorld'.istitle())

90)

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

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

print('1.1'.isnumeric())

93) In the declaration, x = Circle (), x contains a _to Circle object. -

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

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

96)

97) What is testing process' first goal ?

98) Which of these is not a core data type ?

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

100) Leading white space at the beginning of each element, which is used to determine the group of statement

Your score is

You cannot copy content of this page