thatunlike the functions seen so farthis function has two return statements this is perfectly valid and is quite common in functions with if-tests when return statement is executedthe function call is over and any following lines in the function are simply ignored thereforethere is usually no point in having multiple return statements unless they are combined with if-testssinceif the first one is always executed the others will never be reached sometimes we just want piece of code to be executed if condition is trueand to do nothing otherwise in such caseswe can skip the else block and define only an if-testif conditionherewhatever is inside the if-block is executed if condition is trueotherwise the program simply moves to the next line after the block as abovewe can add an else-block to ensure that exactly one of two code blocks is executed if conditionelsefor mathematical functions of the form considered above we usually want to include an else-blocksince we want the function to return meaningful value for all input arguments forgetting the else-block in the definition (xabove would make the function return sin( ( floatfor < <pand otherwise nonewhich is obviously not what we want finallywe cans combine multiple if-else statements with different conditions if condition elif condition elif condition elsenotice the keyword elifshort for else ifwhich ensures that that subsequent conditions are only tested only if the preceding ones are false the conditions are checked one by one andas soon as one is evaluated as truethe corresponding block is executed and the program moves to the first statement after the else block the remaining conditions are not checked if none of the conditions is truethe code inside the else block is executed multiple branching has useful applications in mathematicssince we often see piecewise functions defined on multiple intervals consider for instance the piecewise linear function