A Docstring in Python is a string used for adding comments or summarizing a piece of code in Python.
The main difference between Javadoc and Docstring is that docstring is available during runtime as well. Whereas, Javadoc is removed from the Bytecode and it is not present in .class file.
We can even use Docstring comments at run time as an interactive help manual.
In Python, we have to specify docstring as the first statement of a code object, just after the def or class statement.
The docstring for a code object can be accessed from the '__doc__' attribute of that object.
The use of Pass statement is to do nothing. It is just a placeholder for a statement that is required for syntax purpose. It does not execute any code or command.
Some of the use cases for pass statement are as follows:
1.Syntax purpose:
>>> while True:
... pass # Wait till user input is received
2.Minimal Class: It can be used for creating minimal classes:
>>> class MyMinimalClass:
... pass
3.Place-holder for TODO work: We can also use it as a placeholder for TODO work on a function or code that needs to be implemented at a later point of time.