Olete.in
Articles
Mock Tests
🧪 Python MCQ Quiz Hub
Python MCQS - Function
Choose a topic to test your knowledge and improve your Python skills
1. ord() function in Python return the
Octal number
Ascii value
Decimal Number
All of the above
2. How many argument we require to pass in ord() function in python
1
2
3
Many
3. What we pass in ord() function ?
Any character
Alphabet
Number
Only special character
4. type() function in python is
User defined function
Predefined function
It is not function
None of the above
5. To find the data type of any variable what we use ?
ord
type
filter
lambda
6. Which of the following function are used to find the data type of the numpy array
type
dtype
Both of the above
None of the above
7. Which of the following are used in function
()
[]
{}
None of the above
8. Which of the following is not a predefined function in python
ord()
filter()
join()
None of the above
9. Name the inbuld function of the python
pow
list
set
All of the above
10. Which keyword we use to define a function ?
void
int
any type
def
11. list() function return the
set
dictionary
list
All of the above
12. sin() function is used to find the sine value, which function is used to find the inverse of sine ?
sina
asin
sini
isin
13. Which of the following is correct way to define a function in python?
fuctionname[]
def functionname
def functionname()
def functionname():
14. what is the output of the following function print(type(3))
int
char
array
None of the above
15. What is the output of the following code ? print(type(char))
int
char
string
All of the above
16. Which of the following is returned by the join function ?
string
list
char
integer value
17. Which of the following data type we pass in join() function ?
integer
string
list
list with char elements
18. Which of the following function are valid on list ?
append
pop
index
All of the above
19. Which of the following is not the function of list ?
append
push
pop
index
20. What the append() function returns ?
list
set
string
integer
21. what is the output of the following program l=[1,2,3,4] join(l)
123
Ascii value
Error
None of the above
22. In which data type, append() function is applicable ?
set
Dictionary
List
string
23. It is possible to create list inside another list ?
Yes, it is nested list
No, it will give an error
Yes, it is dynamic list
None of the above
24. What we pass as a argument in append() function ?
Anything
Only integer
Only list
Only Character
25. How we get the ASCII value of any character in python programming language ?
By Ascii() function
By tejh() function
By ord() function
All of the above
26. Function that are defined without the use of def keyword are
predefined function
pass by value function
lambda function
All of the above
27. In lambda function,passing argument and return statement are separated by
Colon
Commas
Semicolon
None of the above
28. If function is defined inside the class then it is called
Modue
class
Object
Method
29. What is the use of the append() function in python list ?
Insert new item at beginning
Insert new item at the end
Insert new item at specified position
All of the above
30. Append() function in python is used for
Insertion
Deletion
Clear the data
Traverse the data
31. What is the use of the index() function in Python List ?
Find the type of the list
Find the index value of the item
Count the number of items
None of the above
32. What is the use of the count() function in python list ?
Count the number of item in list
Count the occurrence of any item
Both of the above
None of the above
33. Return type of index() function in python list ?
String
Number
char
list
34. What we pass in index() function ?
Number
String
List
All of the above
35. Number of argument pass in index() function ?
1
2
3
4
36. How many argument we pass in append() function ?
1
2
3
5
37. How many argument we pass in pop() lust function ?
0
1
3
4
38. Which of the following function is insert item in list according to index value ?
append()
push()
insert()
All of the above
39. Which of the list function not take care of index value to perform the task ?
append()
pop()
clear()
All of the above
40. Which of the following are valid keyword or function for sort the given data ?
sort()
sorting()
Both of the above
None of the above
41. Which of the following is valid for reverse the sequence ?
reverse()
reversed()
Both of the above
None of the above
42. set(list) remove the
all items from the list
last item in list
all character item in list
all duplicate item in list
43. numpy.array() is a function which convert
list to array
array to list
string to array
array to string
44. How we convert the list into the numpy array ?
array(list)
Numpy(list)
Numpy.array(list)
list.array()
45. pop() function is valid on
list
set
Both list and set
None of the above
46. remove() function is valid on
List
Set
List and set
None of the above
47. Which of the following function is use for the file Handling ?
write()
read()
append()
All of the above
48. Which of the following is used to read the text file ?
read()
readline()
readlines()
All of the above
49. What is the use of tell() function in File handling in python ?
It check the available file
It return the number of character in file
Return file type
None of the above
50. Which of the following function is used to find the number of character in text file ?
count()
char()
tell()
key()
51. File pointer read the text file char by char, to find the current position of the pointer which function we used ?
seek()
tell()
key()
None of the above
52. Which of the function is used to pause the current execution ?
pause()
break()
sleep()
require()
53. Number of argument to pass in sleep() function ?
1
2
3
4
54. eval() is used to find the value of the
mathematical function
equation
log
All of the above
55. What is the work of the split() function ?
list to string
string to list
array to list
list to array
56. What we pass in split() function ?
string
integer
list
array
57. Return type of split() function ?
string
array
set
list
58. By default split() function break the string according to the
commas
colon
dot
space
59. Which of the function are used to get the value from the user side ?
scan()
scanf()
scand()
input()
60. What is the use of the input() function in python ?
It is also used for print the statement
It get the value from the user side
Both of the above
None of the above
61. Return type of the input() function is always
string
integer
any data type
None of the above
62. To convert numeric string into integer which function we use ?
str()
int()
char()
type()
63. Which of the following function is used to convert the integer to string
str()
int()
char()
chr()
64. product() function is defined in which of the following ?
pandas
Numpy
Opencv
math
65. To add all item of the list, which function we use ?
add()
sum()
Not possible
None of the above
66. Number of argument we pass in sum() function ?
1
2
3
As much we want
67. To find the power of the two number we have only pow(x,y) function ?
Yes
No
Not to say
pow() is also not valid
68. To find the value of the inverse of tanx in python ?
tana
atan
tani
itan
69. Which of the following is valid to find the inverse of cosine ?
cosa
acos
cosi
icos
70. acos() function is use for finding the value of
inverse of cosine
cosine
sine
inverse of sine
71. What is the use of the filter() function ?
collect some item from sequence
collect all item from sequence
both may be valid
None of the above
72. Filter() function is valid on
string
integer
list
None of the above
73. What is the use of the map() function ?
to assign the value
to change the sequence order
to change the data type in the sequence
to change the data type of the sequence
74. To copy the sign of one number to another which function we use ?
copysign()
signcopy()
copy()
None of the above
75. How many argument we pass in map() function ?
1
2
3
4
76. Which is essential argument to pass in map() function ?
function
sequence
Both of the above
None of the above
77. Which type of function we call as a argument in map() function ?
User defined function
Build In function
lambda function
All of the above
78. After applying the filter() function on the list, the number of item in the list
always decrease
may be decrease
Not increase in any condition
2 and 3 are true
79. Is it possible to pass a lambda function in filter() function ?
Yes
No
Depends on type of filter() function
Depends on type of lambda function
80. To change the lower case alphabet to upper case alphabet , what we use ?
Lower() function
Upper() function
changecase() function
case() function
81. To change the upper case alphabet to lower case alphabet , what we use ?
Lower() function
Upper() function
changecase() function
case() function
82. What we pass as a argument in upper() function ?
integer
list
array
None of the above
83. Return type of the lower() function ?
string
integer
list
array
84. Return type of isupper() function is ?
True
False
True or False
None of the above
85. What is return by the islower() function ?
True
False
True or False
None of the above
86. string is : r4r.com then string.islower() return
True
False
True or False
None of the above
87. string is : this is my string, then title() function return
This is my string
[ This,is,my,string ]
This Is My String
All of the above
88. What is return by the isdigit() function ?
True
False
True or False
None of the above
89. If every character in string is of numeric type then what value is return by isdigit() function ?
True
False
True or False
None of the above
90. What is the use of the isalpha() function in python ?
It check the list for alphabet
It check the array for alphabet
It check the string for alphabet
All of the above
91. Correct syntax for the isalpha() function
isalpha(string)
isalpha()
string(isalpha())
string.isalpha()
92. correct syntax for the isdigit() function ?
isdigit(list)
list.isdigt()
string.isdigit()
isdigit(string)
93. What is the use of the replace() function ?
replace the list by string
replace the string by list
replace content of string by other string
All of the above
94. Minimum number of argument we require to pass in replace() function ?
1
2
3
4
95. Third argument in replace() function is
string
integer
list
array
96. Which of the following function is use to change the case of the alphabet in whole string ?
changecase()
case()
caseswap()
swapcase()
97. string is: MYtext, then swapcase() function return string which is ?
MyText
MYTEXT
myTEXT
None of the above
98. Discard() function is only applicable on
set
list
dictionary
array
99. what is the use of the discard() function ?
Insertion
Removing
counting
Swapping
100. Which of the following function gives an error if we deleted the unknown item that is not present in set.
discard()
remove()
Both of the above
None of the above
Submit