Important Python Mcqs

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

Answer:

d) All of the mentioned

Explanation:

Python has a nifty feature called documentation strings, usually referred to by its shorter name docstrings. DocStrings are an important tool that you should make use of since it helps to document the program better and makes it easier to understand.

Related MCQs

The java compiler generates

a machine code b. byte code c. source code d. HTML Answer: b. byte code Explanation: The Java compiler generates byte code which is then

Aniket Malik

Aniket Malik

CERTIFIED TUTOR/TRAINER WITH 300+ REVIEWS

Facing difficulty with

this concept?