CBSE Class 12 Computer Science Question 1 of 62

Using Python Libraries — Question 1

Back to all questions
1
Question

Question 1

Assertion. The documentation for a Python module should be written in triple-quoted strings.

Reason. The docstrings are triple-quoted strings in Python that are displayed as documentation when help <module> command is issued.

Answer

(a)

Both Assertion and Reason are true and Reason is the correct explanation of Assertion.

Explanation
Docstrings are typically written within triple-quoted strings (i.e., using """ or '''), which allows for multiline strings. When the help<module> command is issued in Python, it retrieves and displays the documentation string (docstring) associated with the specified modules, classes, functions, methods.