• Advertisement
To advertise, place classifieds free ads by category in a forum as a new topic, or in the classified display ads section, or start a classifieds free blog.

Explain help() and dir() functions in Python.(courses providing)

Explain help() and dir() functions in Python.(courses providing)

Postby subha » Tue Jun 26, 2018 7:31 am

The help() function displays the documentation string and help for its argument.

>>> import copy
>>> help(copy.copy)
Help on function copy in module copy:

Best Advanced Python Training in Bangalore
copy(x)

Shallow copy operation on arbitrary Python objects.

See the module’s __doc__ string for more info.

The dir() function displays all the members of an object(any kind).
Best Advanced Python Training in Bangalore

>>> dir(copy.copy)
[‘__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__’]

Best Advanced Python Training in Bangalore
subha
 
Posts: 1
Joined: Tue Jun 26, 2018 7:25 am
Blog: View Blog (0)

  • Similar Topics
    Replies
    Views
    Last post

Return to Classes, Lessons, Workshops, Exams, Tutoring & Training


Mobile Device
  • 1
  • FREE CLASSIFIED ADS
    Free Classified Ads
    There are 3 ways to advertise - your choice: you can place free ads in a forum topic, in the classified display ads section, or you may start your own free blog. Please select the appropriate category and forum for the ad content before you post. Do not spam.
    Caveat emptor - let the buyer beware. Deal at your own risk and peril.
  • Advertisement