defining functions functions that return values one way to get information from function is by having it return value to the caller you have already seen numerous examples of this type of function for exampleconsider this call to the sqrt function from the math librarydiscrt math sqrt( * * *chere the value of * * * is the actual parameter of math sqrt this function call occurs on the right side of an assignment statementthat means it is an expression the math sqrt function must somehow produce value that is then assigned to the variable discrt technicallywe say that sqrt returns the square root of its argument it' very easy to write functions that return values here' an example value-returning function that does the opposite of sqrtit returns the square of its argumentdef square( )return the body of this function consists of single return statement when python encounters returnit exits the function and returns control to the point where the function was called in additionthe value(sprovided in the return statement are sent back to the caller as an expression result we can use our square function any place that an expression would be legal here are some interactive examplessquare( print(square( ) square(xprint( print(square(xsquare( ) let' use the square function to write another function that finds the distance between two points given two points ( and ( )the distance between them is calculated from the pythagorean theorem as ( ) ( ) here is python function to compute the distance between two point objectsdef distance( )dist math sqrt(square( getx( getx()square( gety( gety()return dist using the distance functionwe can augment the interactive triangle program from to calculate the perimeter of the triangle here' the complete program