Approved Facilitation Centre of National Institute of Electronics and Information Technology (NIELIT),(An autonomous Scientific Society of MeitY, Govt. of India)
Test 4 O Level M3
1 / 100
What will be the output of the followingPython code ?def power(x, y=2):r=1for i in range(y):r=r*xreturn rprint (power(3))print (power(3,3))
2 / 100
Hierarchy in a pseudo-code can be shownby :
3 / 100
What will be the output of the followingPython code ?tuple1=(5,1,7,6,2)tuple1.pop(2)print(tuple1)
4 / 100
What is the output of the following ?x=123for i in x:print(i)
5 / 100
Which translator is used to convert assemblylanguage into machine language ?
6 / 100
A detailed flow chart is called as __________.
7 / 100
Given a string x=”hello” What is the outputof x.count(‘l’) ?
8 / 100
What will be output for the following code ?import numpy as npa = np.array( [2, 3, 4, 5] )print(a.dtype)
9 / 100
What will be the output of the followingPython code ?def display(b, n):while n>0:print(b, end=””)n=n-1display(‘z’, 3)
10 / 100
The correct extension of the Python file is____________.
11 / 100
What will be the output of the followingPython code ?len([“hello”,2, 4, 6])
12 / 100
What will be the output of the followingPython code ?d1={“abc”:5,”def”:6,”ghi”:7}print(d1[0])
13 / 100
Python is written in __________.
14 / 100
The connector symbol for flow chart is__________.
15 / 100
Which of the following will read entirecontent of file (file object ‘f’) ?
16 / 100
Which of the following is used to define ablock of code in Python language ?
17 / 100
What will be the output of the following codesnippet ?numbers = (4, 7, 19, 2, 89, 45, 72, 22)sorted_numbers = sorted(numbers)odd_numbers = [x for x in sorted_numbers ifx % 2 != 0]print(odd_numbers)
18 / 100
What will be the output of the followingPython code ?def func(a, b=5, c=10):print(‘a is’, a, ‘and b is’, b, ‘and c is’, c)func(13, 17)func(a=2, c=4)func(5,7,9)
19 / 100
Which one of the following is immutable datatype ?
20 / 100
What is the output of the following code ?def s(n1):print(n1)n1 = n1 +2n2=4s(n2)print(n2)
21 / 100
The contents inside the “for loop” areseparated by :
22 / 100
What will be the output of the followingexpression ?x = 14print(x>>2)
23 / 100
When we open file in append mode the filepointer is at the _________ of the file.
24 / 100
What is the output of the following ?m = 0while m < 5:print(m)m += 1if m == 3:breakelse:print(0)
25 / 100
Which statement is correct to import allmodules from the package ?
26 / 100
Pictorial representation of an algorithm iscalled as __________.
27 / 100
What is the output of the following ?print(max([1, 2, 3, 4], [4, 5, 6], [7]))
28 / 100
What is the output of the following ?n=5while n>0:n-=1if n ==2:continueprint(n)
29 / 100
What will be the output of the following ?print(sum(1,2,3))
30 / 100
Debugging is the process of fixing a__________ in the software.
31 / 100
What is the value of the following Pythoncode ?>>>print(36 / 4)
32 / 100
Which of the following will delete key-valuepair for key=”tiger” in dictionary ?dic={“lion”:”wild”,”tiger”:”wild”,”cat”:”domestic”,“dog”.”domestic”}
33 / 100
What is the output of the following code ?a = set(‘abc’)b = set(‘cdef’)print(a&b)
34 / 100
What will be output for the following code ?import numpy as npary = np.array([1,2,3,5,8])ary = ary + 1print (ary[1])
35 / 100
In python language, which of the followingcannot be defined as variable ?
36 / 100
What type of data is : arr = [(1, 1), (2, 2),(3, 3)] ?
37 / 100
What will be the output of the following codesnippet ?from math import *a = 2.19b = 3.999999c = -3.30print(int(a), floor(b), ceil(c), fabs(c))
38 / 100
Which mode creates a new file if the file doesnot exist ?
39 / 100
Recursive function is __________.
40 / 100
What will be the output of the followingPython code ?x = ‘abcd’for i in x:print(i.upper())
41 / 100
What is the use of the zeros() function inNumpy array in python ?
42 / 100
In which software development phase qualityof software is documented ?
43 / 100
In which of the following, data is storedpermanently ?
44 / 100
Which of the following software is requiredto run the hardware ?
45 / 100
What is the output of the following ?y = ‘klmn’for i in range(len(y)):print(y)
46 / 100
Which function is used to add an element (5)in the list1 ?
47 / 100
Which of the following words is not akeyword of python language ?
48 / 100
What will be the output of the followingPython code ?from math import factorialprint(math.factorial(5))
49 / 100
In which format Binary file containsinformation ?
50 / 100
Which of the following error is returned bythe given code ?>>> f = open(“test.txt”,”w”)>>> f.write(345)
51 / 100
What will be the output of the followingalgorithm for a=5, b=8, c=6 ?Step 1 : StartStep 2 : Declare variables a, b and c.Step 3 : Read variables a, b and c.Step 4 : If a < bIf a < cDisplay a is the smallest number.ElseDisplay c is the smallest number.ElseIf b < cDisplay b is the smallest number.ElseDisplay c is the smallest number.Step 5 : Stop
52 / 100
Which of the following error is returned whenwe try to open a file in write mode whichdoes not exist ?
53 / 100
Which statement will move file pointer 10bytes backward from current position ?
54 / 100
What will be the output of the followingPython code ?from math import *floor(11.7)
55 / 100
Which of the following are valid stringmanipulation functions in Python ?
56 / 100
What will be output for the following code ?import numpy as npa = np.array([1,2,3,5,8])print (a.ndim)
57 / 100
What is the output of following Python code ?>>>print(5*(2//3))
58 / 100
Which of the following is not an advantageof using modules ?
59 / 100
What will be the output of the followingPython code ?example = “helle”example.rfind(“e”)
60 / 100
(C) k ^ ^ l (D) k ^ *lIn python language, which of the followingoperators is the correct option for raising k tothe power l ?
61 / 100
What will following code segment print ?if True or True:if False and True or False:print(‘A’)elif False and False or True and True:print(‘B’)else:print(‘C’)else:print(‘D’)
62 / 100
A _____________ stores information in theform of a stream of ASCII or unicodecharacters i.e. human readable.
63 / 100
Flow charts and Algorithms are used for__________.
64 / 100
What will be the output of the following codesnippet ?d = {3, 4, 5}for k in d:print(k)
65 / 100
Choose the correct option with respect toPython.
66 / 100
What will be the output of followingstatement ?>>>”m”+”nl”
67 / 100
What will be the output of the followingPython code ?>>>list1 = [1, 3]>>>list2 = list1>>>list1[0] = 4>>>print(list2)
68 / 100
f.read(5) will read __________ from a file (fileobject ‘f’).
69 / 100
What is the datatype of x ?import numpy as npa=np.array([1,2,3,4])x= a.tolist()
70 / 100
Kite/diamond symbol in flow chart is usedfor __________.
71 / 100
What is a variable defined outside a functionreferred to as ?
72 / 100
A _______ statement is used when astatement is required syntactically but you donot want any code to execute.
73 / 100
Which of the following declarations isincorrect ?
74 / 100
To use a module in another module, you mustimport it using an ________ statement.
75 / 100
Which function is used to write data in binarymode ?
76 / 100
What will be the output of following ?Y=[2,5J,6]Y.sort()
77 / 100
The sequence logic will not be used while__________.
78 / 100
What will be output for the following code ?import numpy as npa = np.array([[1,2,3],[0,1,4]])print (a.size)
79 / 100
Which of the following is a valid arithmeticoperator in Python ?
80 / 100
The brain of computer system is __________.
81 / 100
What is the output of the following code ?import numpy as npa = np.array([1,2,3])print(a.ndim)
82 / 100
What is the output of the following code ?M=[‘b’ * x for x in range(4)]print(M)
83 / 100
Python supports the creation of anonymousfunctions at runtime, using a construct called__________.
84 / 100
What is ‘f’ in the following statement ?f=open(“Data.txt”, “r”)
85 / 100
What is the output of following code ?import numpy as npa = np.array([[1,2,3],[4,5,6]])print(a.shape)
86 / 100
What is the output of the following code ?import numpy as npa = np.array([1,2,3,5,8])b = np.array([0,3,4,2,1])c = a + bc = c*aprint (c[2])
87 / 100
What will be the output of the followingpseudo code, where & represent ANdoperation ?Integer a, b, cSet b = 5, a = 1c = a & bPrint c
88 / 100
What does readlines() method return ?
89 / 100
What will be the output of the followingpseudo code ?Integer a, bSet a = 10, b = 5a = a mod (a - 6)b = b mod (b - 2)Print a - b
90 / 100
Structured program can be broken into__________ to assign to more than onedeveloper.
91 / 100
What is the output of the following codesnippet ?print([i.lower() for i in “HELLO”])
92 / 100
__________ function returns the currentposition of file pointer.
93 / 100
Which statement will return one line from afile (file object is ‘f’) ?
94 / 100
Which of the following symbols is used torepresent output in a flow chart ?
95 / 100
Choose the correct function declaration offun1() so that we can execute the followingtwo function calls successfully.fun1(25, 75, 55)fun1(10, 20)
96 / 100
Which symbol is used as a flowline to connecttwo blocks in a flow chart ?
97 / 100
Which of the following functions is a built-infunction in python ?
98 / 100
For performing the addition of two numbers,which of the following symbol in a flow chartare used ?
99 / 100
Which of the following is not a controlstructure ?
100 / 100
Your score is
The average score is 34%
Restart quiz
Test 3 O Level M3
In python language, which of the followingoperators is the correct option for raising k tothe power l ?
What is the output of following Pythoncode ?>>>print(5*(2//3))
NumPY stands for :
The average score is 0%
Test 2 O Level M3
What will be the output of the followingPython code ?
def func(a, b=5, c=10):print(‘a is’, a, ‘and b is’, b, ‘and c is’, c)func(13, 17)func(a=2, c=4)func(5,7,9)
Which of the following is a valid dictionary in Python?
Test 1 O Level M3
What will be the datatype of the var in the below code snippet?
var-10
print(type(var))
var "Hello"
What does-5 evaluate to?
Which of the following modules need to be imported to handle date time computations in Python?
. To start Python from the command prompt, use the command
Which of the following functions converts date to corresponding time in Python?
What is the output of the following program: print "Hello World"[::-1]
Which of the following functions is a built-in function in python?
Which of the following types of loops are not supported in Python?
What does pip stand for python?
Which of the following statements are used in Exception Handling in Python?
Which keyword is used for function in Python language?
Which of the following concepts is not a part of Python?
Is Python case sensitive when dealing with identifiers?
How many control statements python supports?
In which language is Python written?
. Which of the following are valid string manipulation functions in Python?
What is the maximum possible length of an identifier?
Which of the following is not a valid set operation in python?
Which one of the following is the correct extension of the Python file ?
What keyword is used in Python to raise exceptions?
Which character is used in Python to make a single line comment ?
What is the output of the code print (9//2)
What is the output of the following code: L-['a','b','c','d'] print("" join(L))
Which of the following statements given below is/are true?
What is the correct command to shuffle the following list?
fruit-['apple', 'banana', 'papaya', 'cherry']
What will be the output of the following code snippet? a=[1,2,3,4,5,6,7,8,9]
a[::2] 10,20,30,40,50,60
print(a)
How is a code block indicated in Python?
. How is a code block indicated in Python?
How can assertions be disabled in Python? A. Passing-O when running python
To read all contents from file object FILE at once we may use
.In which format Binary file contains information
To open a file Myfile.txt, which is stored at d:\Myfolder, for WRITING, we can use
If we do not specify file mode while opening a file, the file will open in ..............mode
To open a file in python language................ function is used
Which of the following file formats are allowed to store data through python programming ?
How do you assign a tuple of length 1 to the variable a? (Check all that are correct.)
What's the main difference between Python lists and tuples?
What is the expression that returns the 'z' in 'baz"?
What will be the output of squares = {x: x*x for x in range(6)}
colors ["red", "green", "burnt sienna", "blue"] Which list index would select the value 'red' from the above list
The function used to convert to datetime is:
Which one of the following has the highest precedence in the expression?
Why does the name of local variables start with an underscore discouraged?
Which of the following keywords is used for function declaration in Python language?
Which options are correct to create an empty set in Python?
Which of the following function is used to find the total number of elements in a numpy array
for i in range (-5,0,1) will run
The following command is substitution when multiple ifs are used
Dictionary has:
To create sequences of numbers, Numpy provides a function range that returns arrays instead of lists analogous to
What is the result of round (0.5)-round(-0.5)?
Which is the special symbol used in python to add comments?
Which of the following keywords is not reversed keyword in python?
csv stands for
Which statement is correct?
PVM is often called
What will be the output of the following Python code? strl="helloworld" str1[::-1]
Which of the following file-modes does retains file data and append new data.
readlines () will return
What is easier for a program to read and write.
. What will be the output?
Def f(x,y,z): return x+y+ z
f(2,30,400)
What is the purpose of NumPy in Python?
What of the following is the use of function in python?
NumPy arrays can be
Which keyword is used for function?
Which of the following method creates a new array object that looks at the same data?
Which of the following would NOT work as a variable name?
Writes a list in a file.
Commnd to write a list in a file.
Which of the following function is used to write List of Strings in file ?
Which among the following statement is false?
Which one of the following is the right way to call a function?
The most important object defined in NumPy is an N-dimensional array type called?
Execution of statements in construct depend on a condition test
What error will occur when you execute the following code? MANGO - APPLE
What keyword would you use to add an alternative condition to an if statement?
NumPy stands for?
Which of following is not a decision-making statement
What will be the output of the following python code?
min (lambda x,y: x if x<y else y) min(101*99, 102*98)
78. What will be the output of the following Python code?
from numpy import random. xrandom.randint(100)
print(x)
How to import NumPy module?
Python uses:
How we install numPy in system?
What is the range of uint32 data type?
How we can change the shape of the NumPy array in python?
NumPy developed by?
What are the attributes of NumPy array?
What is fortran order in NumPy?
Which of the following sets the size of the buffer used in ufumes?
x = [1, 2, 3]x.append(4)print(x)
Which of the following is a Python set operation?
What does the len() function do in Python?
len()
Which of the following will convert a string to a list of characters in Python?
Which Python keyword is used to define an anonymous function?
x = 10y = 5print(x // y)
Which of the following is used to handle exceptions in Python?
What does the break statement do in Python?
break
print(2 ** 3)
The average score is 39%
WhatsApp us