Help() and dir()

Total Post:113

Points:791
 200  View(s)
Ratings:
Rate this:

What is the usage of help() and dir() function in Python? example please ...

  1. Post:140

    Points:984
    Re: Help() and dir()

    Help() function:  

    it's used to display the documentation string and also help in modules, keywords, attributes, and you use a return as a method,attributes. 

    Example :

    my_list = [] 
    help(my_list.append)

    dir() function:  

    The dir() function is used to display the defined symbols and as a arguments for currents local namespace for a local keys. 

    Ex :

    my_list = [] 
    print(dir(my_list))


Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!