Skip to content

Latest commit

 

History

History
18 lines (13 loc) · 367 Bytes

docstring-for-describing-functions.md

File metadata and controls

18 lines (13 loc) · 367 Bytes

Docstring for describing functions

The methods in python can be described with docstring. Docstring for a method can be accessed using __doc__.

def add(self):
    """Create a new user.
    Line 2 of comment...
    And so on... 
    """

def square(n):
    '''Takes in a number n, returns the square of n'''
    return n**2

print(square.__doc__)