Ask coding questions

← Back to all posts
Help me to solve this problem.
ruchiyadav

A python script to print the docstring(documentation string) of the input function?

Answered by ash15khng [earned 5 cycles]
View Answer
Voters
MikayelSargsyan
YousefAhmed8
SimranBisWas
ruchiyadav
Comments
hotnewtop
ash15khng

You can get the docstring of a function by calling its __doc__ property (there are 2 underscores). An example:

ruchiyadav

I cleared my hands on with this help. thank you @ash15khng

ash15khng

@ruchiyadav Nice! Would you mind marking my comment as the answer? Thanks!

nj2079

@ash15khng , @ruchiyadav - can you help me to solve this hands on - its weird - not sure why I am missing

oshiva

how did u do it?? @ruchiyadav

ReshmaGadde1

@ruchiyadav will you share me the exact answer please to solve the handson

PaoloAmoroso

Here's a starting point:

YousefAhmed8

how can i find the right algorithm for this code

NareStepanyan

How do you define a problem statement (English) with user input, user output, Tuple, conditionals and mathematical computation and solve this problem using Python.

oshiva

PLEASE HELP

Problem Statement
Write a python script to print the docstring(documentation string) of the input function.

Instructions
Open the app.py file using vim editor vim app.py.
Press i to insert content in the file.
Write the required python code.
Press the Esc key, and type :wq in the editor to save the file.
Execute the script with command python3 app.py | tee output.txt.
Hint:
use help() function to get the docstring

help()

Welcome to Python 3.6's help utility!

If this is your first time using Python, you should definitely check out
the tutorial on the Internet at https://docs.python.org/3.6/tutorial/.

Enter the name of any module, keyword, or topic to get help on writing
Python programs and using Python modules. To quit this help utility and
return to the interpreter, just type "quit".

To get a list of available modules, keywords, symbols, or topics, type
"modules", "keywords", "symbols", or "topics". Each module also comes
with a one-line summary of what it does; to list the modules whose name
or summary contain a given string such as "spam", type "modules spam".

VaradarajamMadd

What is the correct answer for Write a python script to print the docstring(documentation string) of the input function.?

can u plz help me