Top 1000+ Solved Problem Solving and Python Programming MCQ Questions Answer
Q. Which of the following is a feature of DocString?
a. provide a convenient way of associating documentation with python modules, functions, classes, and methods
b. all functions should have a docstring
c. docstrings can be accessed by the doc attribute on objects
d. all of the mentioned
Q. What are the two main types of functions?
a. custom function
b. built-in function & user defined function
c. user function
d. system function
Q. What is called when a function is defined inside a class?
a. module
b. class
c. another function
d. method
Q. Which of the following is the use of id() function in python?
a. id returns the identity of the object
b. every object doesn’t have a unique id
c. all of the mentioned
d. none of the mentioned
Q. Python supports the creation of anonymous functions at runtime, using a construct called
a. lambda
b. pi
c. anonymous
d. none of the mentioned