- Python Built-in Functions
- Python All Built-in Functions
- Python print() Function
- Python input() Function
- Python int() Function
- Python float() Function
- Python len() Function
- Python range() Function
- Python str() Function
- Python ord() Function
- Python chr() Function
- Python ascii() Function
- Python pow() Function
- Python type() Function
- Python List Functions
- Python list() Function
- Python insert() Function
- Python append() Function
- Python extend() Function
- Python pop() Function
- Python remove() Function
- Python reverse() Function
- Python sort() Function
- Python sorted() Function
- Python Dictionary Functions
- Python dict() Function
- Python update() Function
- Python get() Function
- Python keys() Function
- Python setdefault() Function
- Python fromkeys() Function
- Python items() Function
- Python popitem() Function
- Python Tuple Function
- Python tuple() Function
- Python Set Functions
- Python set() Function
- Python frozenset() Function
- Python String Functions
- Python split() Function
- Python join() Function
- Python format() Function
- Python replace() Function
- Python Iterator Functions
- Python iter() Function
- Python min() Function
- Python max() Function
- Python sum() Function
- Python count() Function
- Python index() Function
- Python copy() Function
- Python clear() Function
- Python next() Function
- Python filter() Function
- Python enumerate() Function
- Python zip() Function
- Python reversed() Function
- Python Number Functions
- Python abs() Function
- Python bin() Function
- Python oct() Function
- Python hex() Function
- Python round() Function
- Python divmod() Function
- Python complex() Function
- Python File Handling Functions
- Python open() Function
- Python read() Function
- Python readable() Function
- Python readline() Function
- Python readlines() Function
- Python write() Function
- Python writable() Function
- Python writelines() Function
- Python close() Function
- Python seek() Function
- Python tell() Function
- Python flush() Function
- Python fileno() Function
- Python truncate() Function
- Python Class Functions
- Python object() Function
- Python property() Function
- Python getattr() Function
- Python setattr() Function
- Python hasattr() Function
- Python delattr() Function
- Python classmethod() Function
- Python staticmethod() Function
- Python issubclass() Function
- Python super() Function
- Python Misc Functions
- Python all() Function
- Python any() Function
- Python isatty() Function
- Python bool() Function
- Python callable() Function
- Python globals() Function
- Python locals() Function
- Python dir() Function
- Python id() Function
- Python isinstance() Function
- Python map() Function
- Python repr() Function
- Python slice() Function
- Python vars() Function
- Python Advance Functions
- Python help() Function
- Python hash() Function
- Python breakpoint() Function
- Python bytes() Function
- Python bytearray() Function
- Python memoryview() Function
- Python compile() Function
- Python eval() Function
- Python exec() Function
- Python Tutorial
- Python Tutorial
- Python Examples
- Python Examples
Python help() Function
The help() function in Python is used, when we need to execute the built-in help system to get the description about any topic like method, object etc. For example:
help(input)
The snapshot given below shows the output produced by the above Python code, demonstrating the help() function:
The output shows the description about input (the input() function).
Python help() Function Syntax
The syntax of help() function in Python, is:
help(obj)
where obj refers to an object.
Python help() Function Example
Here is an example of help() function in Python. This program allows user to enter the name of topic to print the help of that topic:
print("Enter the Name of Object: ", end="") obj = input() print("\n------The", obj, "in Python------") help(obj)
The snapshot given below shows the sample run of above program, with user input chr:
In above sample run, user enters chr as input, and because chr() is a function, therefore with the help() function, the brief description of this function is displayed on the output.
The above program can also be created in a way to continue receiving the object input to print the help of that object, until user enters quit to finish the program:
while True: print("\nEnter the Name of Object: ", end="") obj = input() if obj == "quit": break help(obj)
The sample run with some object inputs, is shown in the snapshot given below:
Get Help about any Object at Run-time in Python
To get help about any object at run-time of the program in Python, just use following code:
help()
The snapshot given below shows the initial output produced by this Python code:
Now type any object and hit ENTER
key to get the help about that specified object. To finish
the program, type quit and hit ENTER
key.
You can get the detail of any module, keyword, or whatever you want to get the help of, just type and
hit ENTER
key to see the detail about the specific topic in Python.
« Previous Function Next Function »