cause the function name says what is returnedand the parameter names clearly indicate what is expected none of the functions have any way of indicating what happens if the name isn' found--do they returnsay- or do they raise an exceptionsomehow such information needs to be documented for users of the function we can add documentation to any function by using docstring--this is simply string that comes immediately after the def lineand before the function' code proper begins for examplehere is the shorten(function we saw earlierbut this time reproduced in fulldef shorten(textlength= indicator=")"""returns text or truncated copy with the indicator added text is any stringlength is the maximum length of the returned string (including any indicator)indicator is the string added at the end to indicate that the text has been shortened shorten("second variety"'second varietyshorten("voices from the street" 'voices from th shorten("radio free albemuth" "*"'radio fre*""if len(textlengthtext text[:length len(indicator)indicator return text it is not unusual for function or method' documentation to be longer than the function itself one convention is to make the first line of the docstring brief one-line descriptionthen have blank line followed by full descriptionand then to reproduce some examples as they would appear if typed in interactively in and we will see how examples in function documentation can be used to provide unit tests argument and parameter unpacking sequence unpacking |we saw in the previous that we can use the sequence unpacking operator (*to supply positional arguments for exampleif we wanted to compute the area of triangle and had the lengths of the sides in listwe could make the call like thisheron(sides[ ]sides[ ]sides[ ])or simply unpack the list and do the much simpler callheron(*sidesand if the list (or other sequencehas more items than the function has parameterswe can use slicing to extract exactly the right number of arguments