Python Forum
How to print the docstring(documentation string) of the input function ? - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Homework (https://python-forum.io/forum-9.html)
+--- Thread: How to print the docstring(documentation string) of the input function ? (/thread-24679.html)



How to print the docstring(documentation string) of the input function ? - Kishore_Bill - Feb-27-2020

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)



RE: How to print the docstring(documentation string) of the input function ? - buran - Feb-27-2020

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.
>>>