Help () function in Python
The built-in help () function in Python is used to display documents and invoke the help system of modules, functions, classes, keywords .
The syntax for help () in Python
help(object)
The parameters of the help () function:
object
: the object you want to display information or call the help system.
The help () function is used for interaction, used in interpreters when you need help writing a program or using Python modules.
1. Parameter is an object passed to help () (not a string)
Try running the following command on Python shell:
>>> help(list)
>>> help(dict)
>>> help(print)
>>> help([1, 2, 3])
2. Parameter is the string passed to help ()
If the parameter is passed as a string, the given string will be searched and returns the name of the module, function, class, method, keyword or document topic and the page showing the help system.
Try running the following command on Python shell:
>>> help('random thing')
>>> help('print'))
>>> help('def')
>>> from math import * help('math.pow')
3. No parameters passed to help ()
If no arguments are passed, the interactive help system will boot on the console.
>>> help()
You can then enter the object name you need to get help with writing programs or suggestions using Python modules. For example:
help> True
help> 'print'
help > print
To exit help () help and return to the interpreter, you need to enter quit
and enter.
help > quit
See also: Built-in Python functions
You should read it
- Max () function in Python
- The function set () in Python
- The map () function in Python
- The next () function in Python
- The oct () function in Python
- Functions in Python
- Min () function in Python
- Zip () function in Python
- The function dir () in Python
- The float () function in Python
- Int () function in Python
- Sum () function in Python
Maybe you are interested
Foods that help you relieve constipation immediately
10 Christmas-themed YouTube backgrounds to help create a festive atmosphere
Android's new Find Nearby feature helps detect unwanted Bluetooth tracking devices
7 Essential Google Workspace Features to Help You Work Faster
How Task Batching Technique Helps Improve Concentration
Hot denim trends to help you stay stylish in winter