Python: Documentation of a built-in-function
Python Class ( Basic ): Exercise-4 with Solution
'builtins' module provides direct access to all 'built-in' identifiers of Python.
Write a Python program that imports the abs() function using the builtins module, displays the documentation of the abs() function and finds the absolute value of -155.
Sample Solution:
Python Code:
import builtins
help(builtins.abs)
print(builtins.abs(-155))
Sample Output:
Help on built-in function abs in module builtins: abs(x, /) Return the absolute value of the argument. 155
Flowchart:
Python Code Editor:
Contribute your code and comments through Disqus.
Previous: Write a Python program to create an instance of a specified class and display the namespace of the said instance.
Next: Define a Python function student(). Using function attributes display the names of all arguments.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.
It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.
https://www.w3resource.com/python-exercises/class-exercises/python-class-basic-1-exercise-4.php
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics