the programmer if a_number raise runtimeerror("you can' use negative number"elseprint(math sqrt(a_number)traceback (most recent call last)file ""line in raise runtimeerror("you can' use negative number"runtimeerroryou can' use negative number there are many kinds of exceptions that can be raised in addition to the runtimeerror shown above see the python reference manual for list of all the available exception types and for how to create your own defining functions the earlier example of procedural abstraction called upon python function called sqrt from the math module to compute the square root in generalwe can hide the details of any computation by defining function function definition requires namea group of parametersand body it may also explicitly return value for examplethe simple function defined below returns the square of the value you pass into it def square( )return * square( square(square( ) the syntax for this function definition includes the namesquareand parenthesized list of formal parameters for this functionn is the only formal parameterwhich suggests that square needs only one piece of data to do its work the detailshidden "inside the box,simply compute the result of * and return it we can invoke or call the square function by asking the python environment to evaluate itpassing an actual parameter valuein this case note that the call to square returns an integer that can in turn be passed to another invocation we could implement our own square root function by using well-known technique called "newton' method newton' method for approximating square roots performs an iterative computation that converges on the correct value the equation new_guess old_guess * old_guess introduction