def docstring(fname):
print(fname.__doc__)
fname = input()
docstring(fname)
Given input:
print
The question is about to print the __doc__
of the print
keyword, but here we can get output directly by command (print.__doc__
) but while passing the variable (fname
) to a function (docstring
) and from there printing __doc__
showing different result as it is showing doc of variable but I need the doc of value in the variable.
Showing output:
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
Required output
print(value, ..., sep=' ', end='\n', file=sys.stdout, flush=False)\n\nPrints the values to a stream, or to sys.stdout by default.\nOptional keyword arguments:\nfile: a file-like object (stream); defaults to the current sys.stdout.\nsep: string inserted between values, default a space.\nend: string appended after the last value, default a newline.\nflush: whether to forcibly flush the stream