Replace _doc_ (single underline on each side) with __doc__ (double underlines)
To illustrate, let's define your function and display the documentation:
>>> def nam(i):
... """passing the name to
... a function"""
... print('hello '+i+' good mornin')
...
>>> nam.__doc__
'passing the name to\n a function'
The method above works. The method below, however, fails:
>>> nam._doc_
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'function' object has no attribute '_doc_'
The reason is that __doc__ needs two underline characters on each side, not just one.
Documentation
From the python online documentation:
docstring
A string literal which appears as the first expression
in a class, function or module. While ignored when the suite is
executed, it is recognized by the compiler and put into the __doc__
attribute of the enclosing class, function or module. Since it is
available via introspection, it is the canonical place for
documentation of the object.