in Technology by
What is the use of help() and dir() functions?

1 Answer

0 votes
by

help() function in Python is used to display the documentation of modules, classes, functions, keywords, etc. If no parameter is passed to the help() function, then an interactive help utility is launched on the console.
dir() function tries to return a valid list of attributes and methods of the object it is called upon. It behaves differently with different objects, as it aims to produce the most relevant data, rather than the complete information.

  • For Modules/Library objects, it returns a list of all attributes, contained in that module.
  • For Class Objects, it returns a list of all valid attributes and base attributes.
  • With no arguments passed, it returns a list of attributes in the current scope.

Related questions

0 votes
    How can set row number for each table row created by dir-paginate angularJs. I use two way code ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 14, 2022 in Education by JackTerrance
0 votes
    Bit of a noob question but I'm building an app in react native and to make development a bit ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 21, 2022 in Education by JackTerrance
0 votes
    Name the class that is used for different mathematical functions.(in java) PLEASE ANSWER FAST URGENT HELP ... BRAINLIEST FOR SURE☆☆ Select the correct answer from above options...
asked Dec 31, 2021 in Education by JackTerrance
0 votes
    To get help on a topic in Docker, you can use __________. (1)docker --help topicName (2)docker topicName --help...
asked May 2, 2021 in Technology by JackTerrance
0 votes
    What are the differences between t.test() and t.data.frame()? When do you use these two functions?...
asked Oct 16, 2020 in Technology by JackTerrance
0 votes
    What are the different ways of passing parameters to the functions? Which to use when?...
asked Jan 18, 2021 in Technology by JackTerrance
+1 vote
    What are the different ways of passing parameters to the functions in C Programming? Which to use when?...
asked Nov 9, 2020 in Technology by JackTerrance
0 votes
    Hello mates….what is the use of keyword “import”??need ur help… Select the correct answer from above options...
asked Dec 24, 2021 in Education by JackTerrance
0 votes
    If there are more than one file(main.lua) which contains code and I declare some variables and functions ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Dec 31, 2021 in Education by JackTerrance
0 votes
    Write C program that use both recursive and non recursive functions to perform Linear search for a Key value in a given list. Select the correct answer from above options...
asked Dec 17, 2021 in Education by JackTerrance
0 votes
    What I'm trying to do here is use the 2 functions but I don't know how to use both of them ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    What I'm trying to do here is use the 2 functions but I don't know how to use both of them ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 4, 2022 in Education by JackTerrance
0 votes
    In java, can we use the string buffer functions for string chapter ? Select the correct answer from above options...
asked Dec 24, 2021 in Education by JackTerrance
0 votes
    _______ is a type of software designed to help the user's computer detect viruses and avoid them. Malware Adware Antivirus Both B and C...
asked Mar 4, 2021 in Technology by JackTerrance
0 votes
    What exactly do you know about the Tortoise SVN and what sort of help it offers to the users?...
asked Feb 21, 2021 in Technology by JackTerrance
...