Python: Documentation of a built-in-function
'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.
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics