Retrieving docstrings
You and a group of friends are working on building an amazing new Python IDE (integrated development environment -- like PyCharm, Spyder, Eclipse, Visual Studio, etc.). The team wants to add a feature that displays a tooltip with a function's docstring whenever the user starts typing the function name. That way, the user doesn't have to go elsewhere to look up the documentation for the function they are trying to use. You've been asked to complete the build_tooltip()
function that retrieves a docstring from an arbitrary function.
You will be reusing the count_letter()
function that you developed in the last exercise to show that we can properly extract its docstring.
This exercise is part of the course
Writing Functions in Python
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Get the "count_letter" docstring by using an attribute of the function
docstring = ____.____
border = '#' * 28
print('{}\n{}\n{}'.format(border, docstring, border))