Python Forum

Full Version: How to print the docstring(documentation string) of the input function ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Write a python script to print the docstring(documentation string) of the input function in Python 3? I’m new to Python and unable to find the answers for this question. I tried myself as below but no luck.

answer = input("question?")  # calls the function
obj = input  # doesn't call the function
docs = myobject.__doc__
docs = len.__doc__
print(something)
Not very clear what you try to achieve, but
>>> print(input.__doc__)
Read a string from standard input.  The trailing newline is stripped.

The prompt string, if given, is printed to standard output without a
trailing newline before reading input.

If the user hits EOF (*nix: Ctrl-D, Windows: Ctrl-Z+Return), raise EOFError.
On *nix systems, readline is used if available.
>>>