A Unit of MGMS NGO (Registered Under MSME – UDYAM-HP-04-0032654), NIELIT/DLC/E-Prov. 88006289
Test 4 O Level M3
1 / 100
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))
2 / 100
Hierarchy in a pseudo-code can be shown by :
3 / 100
What will be the output of the following Python code ? tuple1=(5,1,7,6,2) tuple1.pop(2) print(tuple1)
4 / 100
What is the output of the following ? x=123 for i in x: print(i)
5 / 100
Which translator is used to convert assembly language into machine language ?
6 / 100
A detailed flow chart is called as __________.
7 / 100
Given a string x=”hello” What is the output of x.count(‘l’) ?
8 / 100
What will be output for the following code ? import numpy as np a = np.array( [2, 3, 4, 5] ) print(a.dtype)
9 / 100
What will be the output of the following Python code ? def display(b, n): while n>0: print(b, end=””) n=n-1 display(‘z’, 3)
10 / 100
The correct extension of the Python file is ____________.
11 / 100
What will be the output of the following Python code ? len([“hello”,2, 4, 6])
12 / 100
What will be the output of the following Python 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 entire content of file (file object ‘f’) ?
16 / 100
Which of the following is used to define a block of code in Python language ?
17 / 100
What will be the output of the following code snippet ? numbers = (4, 7, 19, 2, 89, 45, 72, 22) sorted_numbers = sorted(numbers) odd_numbers = [x for x in sorted_numbers if x % 2 != 0] print(odd_numbers)
18 / 100
What will be the output of the following Python 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 data type ?
20 / 100
What is the output of the following code ? def s(n1): print(n1) n1 = n1 +2 n2=4 s(n2) print(n2)
21 / 100
The contents inside the “for loop” are separated by :
22 / 100
What will be the output of the following expression ? x = 14 print(x>>2)
23 / 100
When we open file in append mode the file pointer is at the _________ of the file.
24 / 100
What is the output of the following ? m = 0 while m < 5: print(m) m += 1 if m == 3: break else: print(0)
25 / 100
Which statement is correct to import all modules from the package ?
26 / 100
Pictorial representation of an algorithm is called 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=5 while n>0: n-=1 if n ==2: continue print(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 Python code ? >>>print(36 / 4)
32 / 100
Which of the following will delete key-value pair 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 np ary = np.array([1,2,3,5,8]) ary = ary + 1 print (ary[1])
35 / 100
In python language, which of the following cannot 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 code snippet ? from math import * a = 2.19 b = 3.999999 c = -3.30 print(int(a), floor(b), ceil(c), fabs(c))
38 / 100
Which mode creates a new file if the file does not exist ?
39 / 100
Recursive function is __________.
40 / 100
What will be the output of the following Python code ? x = ‘abcd’ for i in x: print(i.upper())
41 / 100
What is the use of the zeros() function in Numpy array in python ?
42 / 100
In which software development phase quality of software is documented ?
43 / 100
In which of the following, data is stored permanently ?
44 / 100
Which of the following software is required to 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 a keyword of python language ?
48 / 100
What will be the output of the following Python code ? from math import factorial print(math.factorial(5))
49 / 100
In which format Binary file contains information ?
50 / 100
Which of the following error is returned by the given code ? >>> f = open(“test.txt”,”w”) >>> f.write(345)
51 / 100
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 < c Display a is the smallest number. Else Display c is the smallest number. Else If b < c Display b is the smallest number. Else Display c is the smallest number. Step 5 : Stop
52 / 100
Which of the following error is returned when we try to open a file in write mode which does not exist ?
53 / 100
Which statement will move file pointer 10 bytes backward from current position ?
54 / 100
What will be the output of the following Python code ? from math import * floor(11.7)
55 / 100
Which of the following are valid string manipulation functions in Python ?
56 / 100
What will be output for the following code ? import numpy as np a = 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 advantage of using modules ?
59 / 100
What will be the output of the following Python code ? example = “helle” example.rfind(“e”)
60 / 100
(C) k ^ ^ l (D) k ^ *l In python language, which of the following operators is the correct option for raising k to the 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 the form of a stream of ASCII or unicode characters i.e. human readable.
63 / 100
Flow charts and Algorithms are used for __________.
64 / 100
What will be the output of the following code snippet ? d = {3, 4, 5} for k in d: print(k)
65 / 100
Choose the correct option with respect to Python.
66 / 100
What will be the output of following statement ? >>>”m”+”nl”
67 / 100
What will be the output of the following Python code ? >>>list1 = [1, 3] >>>list2 = list1 >>>list1[0] = 4 >>>print(list2)
68 / 100
f.read(5) will read __________ from a file (file object ‘f’).
69 / 100
What is the datatype of x ? import numpy as np a=np.array([1,2,3,4]) x= a.tolist()
70 / 100
Kite/diamond symbol in flow chart is used for __________.
71 / 100
What is a variable defined outside a function referred to as ?
72 / 100
A _______ statement is used when a statement is required syntactically but you do not want any code to execute.
73 / 100
Which of the following declarations is incorrect ?
74 / 100
To use a module in another module, you must import it using an ________ statement.
75 / 100
Which function is used to write data in binary mode ?
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 np a = np.array([[1,2,3],[0,1,4]]) print (a.size)
79 / 100
Which of the following is a valid arithmetic operator in Python ?
80 / 100
The brain of computer system is __________.
81 / 100
What is the output of the following code ? import numpy as np a = 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 anonymous functions 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 np a = np.array([[1,2,3],[4,5,6]]) print(a.shape)
86 / 100
What is the output of the following code ? import numpy as np a = np.array([1,2,3,5,8]) b = np.array([0,3,4,2,1]) c = a + b c = c*a print (c[2])
87 / 100
What will be the output of the following pseudo code, where & represent ANd operation ? Integer a, b, c Set b = 5, a = 1 c = a & b Print c
88 / 100
What does readlines() method return ?
89 / 100
What will be the output of the following pseudo code ? Integer a, b Set a = 10, b = 5 a = 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 one developer.
91 / 100
What is the output of the following code snippet ? print([i.lower() for i in “HELLO”])
92 / 100
__________ function returns the current position of file pointer.
93 / 100
Which statement will return one line from a file (file object is ‘f’) ?
94 / 100
Which of the following symbols is used to represent output in a flow chart ?
95 / 100
Choose the correct function declaration of fun1() so that we can execute the following two function calls successfully. fun1(25, 75, 55) fun1(10, 20)
96 / 100
Which symbol is used as a flowline to connect two blocks in a flow chart ?
97 / 100
Which of the following functions is a built-in function in python ?
98 / 100
For performing the addition of two numbers, which of the following symbol in a flow chart are used ?
99 / 100
Which of the following is not a control structure ?
100 / 100
Your score is
The average score is 34%
Restart quiz
Test 3 O Level M3
In python language, which of the following operators is the correct option for raising k to the power l ?
NumPY stands for :
The average score is 0%
Test 2 O Level M3
What will be the output of the following Python 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 = 10 y = 5 print(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%