What is DocString???

Posted on February 19, 2021

Docstring is a convenient way to identify that what is executing in a function. It is a type of comment which we can write within a function.That comment write within """ ("""example""").The syntax of Docsting is .__doc__ .


def function1(a,b):

"""This is a function used for calculating the average of two numbers."""

average= (a+b)/2


function1(5, 6)



This is a function which is calculating the average of two numbers.

Sign In for comment and like the post.