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={5,6,7}

>>> sum(a,5)

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

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

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

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

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

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

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

s1.issubset(s1)

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

9)

10)

11) In Python, which of the following will create a block in a compound statement ?

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

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

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

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

14) The scope rule in Python are summarized as____.

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

s={2, 5, 6, 6, 7}

s

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

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

18) What is identity array?

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

20) ____ is a set of functions you want to include in your application.

21) What is the output of the following?

m=0
while m<5:
    m+=1
    if m==3:
        break
    else:
print(0)

22) Error does not fall into any category



24)

What will be the output of the following Python code?

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

25) Tool ________ is used for program design.

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

  1. >>>t=(1,2,4,3)
  2. >>>t[1:-1]

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

28)

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

30) Which of the following environment variable for Python tells the Python interpreter where to locate the module files imported into a program ?

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

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

print('1Rn@'.lower())

33) What is the output of >>>float('12.6')

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

35) In the Python statement x = a + 5 - b : a and b are

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

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

38) Which is/are the the valid string value in Python

39) Is the following Python code valid?

>>> a,b,c=1,2,3  >>> a,b,c

40) To give a default separator with print() argument is used.

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

42) How is a function declared in Python?

43) In which year was the Python language developed?

44) Which type of Error generate, when the argument have invalid values specified?

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

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

print("abcdef".find("cd"))

47) If list1=[10,20,30], then operation list1*2 returns ____ .

48) Which of the following refers to mathematical function?

49) What is the return type of function id?

50) You don't have to pay for Python and you can view its source code too. It means Python is ..........

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

52) Which of the following is a Python tuple?

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

54) Which of the following functions take iterables(can be zero or more), makes iterator that aggregates elements based on the iterables passed, and returns an iterator of tuples.

55) Diamond shaped symbol is used in flowcharts to show the

56) To return the length of string s what command do we execute?

57) The .......... construct repeats a set of statements a specified number of times or as long as a condition is true.

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

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

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

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

61) A natural number 1 is also an ____ .

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

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

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

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

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

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

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

66) Testing is known as :

67) Which of the statements about modules is false?

68) What is the default value of encoding in encode()?

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

70) What will be the output of the following expression ?

x =4
print(x<<2)

 

71) Designing the problem in known as

72) Following is true for understanding of a problem -

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

74) Python code can run on variety of plateforms, it means Python is a _____language.

75) The operator returns the quotent after division.

76) Which of the following will run without errors?

77)  

What will be the output of the following Python code?

>>>"Welcome to Python".split()

77)  

78) In Python, a variable must be declared before it is assigned a value.

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

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

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

81) Diagram that represents steps or operations involved in any kind of process is called

82) In Python, a complex number is represented as:

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

  d = {0: 'a', 1: 'b', 2: 'c'}  for x, y in d.items():      print(x, y)

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

Integer a
Set a =4
do
	print a + 2
      a = a-1
while (a not equals 0)
end while

85) Data structure used in recursion.

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

x<<2

87) Which of these about a set is not true?

88) What will be the result of the expression 10 or 0 ?

89) Why are local variable names beginning with an underscore discouraged?

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

91) which one is an Assignment Operator

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

94) Which of the following is an invalid variable?

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

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

>>> a=(1,2,3,4)  >>> del(a[2])

97) Which one is not the attribute of a file?

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

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

100) Which of the following language is understood by computer?

Your score is

You cannot copy content of this page