help() and dir() both are built-in functions of python.
help() function:
If no argument is given “help()”, the interactive help system starts on the interpreter console.
If argument is given then it shows its documentation string along with modules, keywords and attributes.
>>> def myfunc():
... '''This is myfunc'''
... x = 2
... return x
...
>>> help(myfunc)
Help on function myfunc in module __main__:
myfunc()
This is myfunc
dir() function:
Without arguments, it returns the list of names in the current local scope.
With an argument, attempt to return a list of valid attributes for that object.
>>> dir()
['__annotations__', '__builtins__', '__doc__', '__loader__', '__name__', '__package__', '__spec__', 'myfunc']
>>> dir(myfunc)
['__annotations__', '__call__', '__class__', '__closure__', '__code__', '__defaults__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__get__', '__getattribute__', '__globals__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__kwdefaults__', '__le__', '__lt__', '__module__', '__name__', '__ne__', '__new__', '__qualname__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__']
Comment here