Top 1000+ Solved Problem Solving and Python Programming MCQ Questions Answer
Q. The function divmod(a,b), where both ‘a’ and ‘b’ are integers is evaluated as:
a. (a%b, a//b)
b. (a//b, a%b)
c. (a//b, a*b)
d. (a/b, a%b)
Q. Which of the following functions does not necessarily accept only iterables as arguments?
a. enumerate()
b. all()
c. chr()
d. max()
Q. Which of the following functions accepts only integers as arguments?
a. ord()
b. min()
c. chr()
d. any()
Q. Suppose there is a list such that: l=[2,3,4]. If we want to print this list in reverse order, which of the following methods should be used?
a. reverse(l)
b. list(reverse[(l)])
c. reversed(l)
d. list(reversed(l))
Q. Which of the following functions will not result in an error when no arguments are passed to it?
a. min()
b. divmod()
c. all()
d. float()
Q. Which of the following functions does not throw an error?
a. ord()
b. ord(‘ ‘)
c. ord(”)
d. ord(“”)
Q. Which of the following is the use of function in python?
a. functions are reusable pieces of programs
b. functions don’t provide better modularity for your application
c. you can’t also create your own functions
d. all of the mentioned