-3

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

  • use help() function to get the docstring
Abbas Mirza
  • 9
  • 1
  • 5

3 Answers3

2

Expected answer is

help(input)
Pavan S P
  • 21
  • 2
1

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)

fbraga
  • 711
  • 4
  • 9
-1

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}')

root13
  • 1
  • 3