Write a python script to print the docstring(documentation string) of the input function. Hint:
- use help() function to get the docstring
Write a python script to print the docstring(documentation string) of the input function. Hint:
The built-in input
has a docstring so you're looking for this(?):
print(input.__doc__)
Calling help
sure does work (python 2 and 3):
help(input)
num = input(enter : ) ''' hello''' print(num.doc) GNU nano 2.9.3 test.py
def function(l):
'''this is docstring'''
return l
l1 = input('enter name : ')
v = function(l1) print(f'{function.doc} {l1}')