#example use from math import log print( ( ) ( )-log( - )the output from the print statement indicates that the approximation improves as the number of terms is increasedas is usual for such approximating series for many purposesit would be useful if the function returned the error of the approximationthat isln( xl(xn)in addition to the value of the sumfrom math import log def (xn) for in range( , + ) + ** / value_of_sum error -log( -xvalue_of_sum return value_of_sumerror typical callx valueerror (xna function does not need return statement all the functions considered so far have included return statement while this will be the case for most of the functions we write in this coursethere will be exceptionsand function does not need to have return statement for instancesome functions only serve the purpose of printing information to the screenas in def somefunc(obj)print(objreturn_value somefunc( herethe last line does not make much sensealthough it is actually valid python code and will run without errors if somefunc does not return anythinghow can we then call the function and assign the result to variableif we do not include return statement in functionpython will automatically return variable with value none the value of the variable return_value in this case will therefore be nonewhich is not very usefulbut serves to illustrate the behavior of function with no return statement most functions we will write in this course will either return variables or print or plot something to the screen one typical use of function without return value is to print information in tabular format to the screen this is useful in many contextsincluding studying the convergence of series approximations such as the one above the following function calls the ( ,nfunction defined aboveand uses for loop to print relevant information in nicely formatted table