1.
What is the use of return statement in a function in Python?
2.
Backward indexing in a list ___________ starts from the number
3.
If reverse = true in the sort() function, the elements of the list are _____sorted in the order they are
4.
__________ displays an error if no value is given as an argument
5.
Which of the following keywords is used to import a module in Python?
6.
Which method in Python sorts the elements of a list in reverse order?
7.
arrange the codes used to remove elements from a nested list using the remove() function In order
numbers = [[1,2],[,;a;,4],[5,6]]
print(numbers)
numbers[1].remove(‘a’)
[[1,2],[3,4],[5,6]]Deselect Answer
8.
What is the function of Python’s random module?
9.
Which is correct?
Statements A: there are many modules in Python standard library, which we can import and use the methods of the modules
Statements B: for example, the math module is used in Python to perform various scientific and mathematical calculations.
Deselect Answer
10.
Which is correct?
Statement A: the reverse()function sorts the elements of a list in ascending order
Statement B: the sort()function arranges the elements of a list in reverse order, i.e. from last to first
Deselect Answer
11.
Which element is used to find the actual position of elements in a Python list?
12.
In the math module ________ what function is used to find the square root?
13.
Which is correct?
Assertion : when the arguments of the function call statement match the number and order of a parameters of the defined function , then such arguments are called positional arguments
Reason : during a function call, the argument list contains default arguments first , followed by positional arguments
Deselect Answer
14.
To get the absolute value of a number (absolute value)_________ is the function used?
15.
Which is correct?
Statement A: the insert() function is used to delete data from a specific location in a list
Statement B: The extend() functions adds elements from another list to a list individually
Deselect Answer
16.
Which is correct?
Assertion : math.pow (8,2) this function returns 64 as the result. Reason : the pow() function always displays a floating point value
Deselect Answer
17.
Which is correct?
Statement A : a function is an organized and reusable block of program code that performs a specific task
Statement B : to write a function, it must always depend on another function
Deselect Answer
18.
What is the purpose of the global keyword in Python?
19.
Which keyword is used to define a function in Python?
20.
Which of the following arguments is preceded by an asterisk?
21.
Which of the following functions is used to add a new element to the end of a Python list?
22.
Which is correct?
Statements A: the random() function in Python always returns a floating point number
Statements B: the randint() function always returns an integer (positive or negative)
Deselect Answer
23.
Which of the following statements about function arguments in Python is correct?
24.
Assertion: [1,2,[3,4],5,6] this is nested list Reason: nested lists always contain numbered lists as elements
25.
__________ is the function part of the statistics module?
26.
n = [15,10,25,30,5] using the max()function on this list will output _________
27.
Which is correct?
Assertion : the function can take input values as parameters, execute them, and return output to the calling function through a return statement
Reason : A function in Python can return multiple values
Deselect Answer
28.
Which of the following is not included in the header part of a function?
29.
Which method is used to remove an element at a specific position in a Python list?
30.
The output of the function math.ceil( -7.4) will be
31.
Which of the following functions calculates the average value of a data set?
32.
colors = [‘red’,’green’,’black’,] to delete the color ‘black; from this list’arrange
This codes given below in random order
colors.remove(‘black’)
colors = [‘red’,’green’,’black’,] [
[‘red’,’green’]
print(colors)
Deselect Answer
33.
Which is correct?
Statement A: the pop() function is used to delete data from a specific location in a list
Statement B: the remove() function is used to find how many times a particular data item appears in the list of data or elements
Deselect Answer
34.
If n =[2,1,3,4,3,5,3,7,8] then the output of n.count(3)will be____
35.
Which is correct?
Assertion: v = [car,train,bus,auto] using the min()function onthe list will output ‘auto’
Reason: the min()function displays the results in alphabetical order (a to z)
Deselect Answer