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?

print('__foo__'.isidentifier())

2) Suppose list1 is [1, 5, 9], what is sum(list1)?

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

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

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

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


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

>>>max("what are you")

8) Function blocks begin with the keyword _.

9) In which year was the Python language developed?

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

print("Hello {0!r} and {0!s}".format('foo', 'bin'))

11) Which of the following precedence order is correct in Python?

12) Which of the following commands will create a list?

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

>>> import collections  >>> a=collections.namedtuple('a',['i','j'])  >>> obj=a(i=4,j=7)  >>> obj

14) ____ is used to close a file object(fp).

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

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

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

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

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

18) The ………. construct allows to choose statements to be executed, depending upon the result of a condition.

19) An empty/null statement in Python is

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

21) Which type of Programming does Python support?

22) In a flow chart, which of the following is used to test the condition ?

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

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

  A = [[1, 2, 3],        [4, 5, 6],        [7, 8, 9]]  [A[row][1] for row in (0, 1, 2)]

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

True = False  while True:      print(True)      break

26) In python we can change the value of variable

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

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

 

28) In which of the following data type, duplicate items are not allowed?

29) To add a new element to a list we use which command?

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

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

31) The contents inside the “for loop” are separated by?

32) The ____ function takes two parameters, filename and mode.


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

35) What is testing process’ first goal ?

36) Which is/are the valid statement to print Hello Word in Python ?

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

38) The symbol used for conditional statement n a flow chart is a ____

39) The operator returns the quotent after division.

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

not(10<20) and not(10>30)

41) Which of the following executes the programming code line by line?


42)

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

print('Hello World'.istitle())

43) How many keywords are there in python 3.7?

44) Python code can run on a variety of platforms, it means Python is a _____ language.

45) What is the output of the following program ? print 0.1+0.2==0.3

46) What will be the output of following statement ?

>>>"m"+"nl"

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

48) Testing is known as :

49) Python operator always yields the result of

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

s=set()

type(s)

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

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

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

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

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

    r = [11, 12, 13, 14, 15, 16, 17, 18, 19]  A = [[0, 10, 20],

55) Which of these are keyword?

56) What is identity array?

57) Istrip() method is used for :

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

print("abc DEF".capitalize())

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

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

60) _______ is latest high level language.

61) What is the output of the expression : 3*1**3 ?

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

63) Designing the problem in known as

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

for i in range(5):      if i == 5:          break      else:          print(i)  else:      print("Here")

65) The ______ mode of Python gives instant result of typed statement

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

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

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

68) Which function is used to get the Data Type of any value?

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

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

print("abcdef".center())

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

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

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

for i in a:

print (i, end=” “)

73) Which of the following operators has the highest precedence?

74) Users write the programs in which language?

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

76) Set of statements is executed again and again based upon conditional test.

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

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

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

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

80) What value does the following expression evaluate to ?

print(5 + 8 * ((3*5)-9)/10)

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

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

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

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

84) Which amongst this is not a jump statement ?

85) What is the output of print(k) in the following Python code snippet?

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

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

def unpack(a,b,c,d):
    print(a+d)
x = [1,2,3,4]
unpack(*x)

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

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

88) What arithmetic operators cannot be used with strings?

89) Recursive functions usually take _____ memory space than non- recursive function.

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

91) ____ is a function of dictionary gets all the values from the dictionary.

92) The data type of an expression int(m)/int(n) will result in:

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

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

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

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

print('ab'.isalpha())

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

97) range(3) in Python is equivalent to:

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

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

  i = 0  while i < 3:      print(i)      i += 1  else:      print(0)

100) Given a function that does not return any value, What value is thrown by default when executed in shell.

Your score is

You cannot copy content of this page