chain of responsibility pattern def main_function(head)head execute(if __name__ ="__main__"hd function class(current hd current next_to_execute function class(current current next_to_execute current next_to_execute function class(current current next_to_execute current next_to_execute function class(main_function(hdeven though the amount of code written is significantly more than in the first instanceyou should begin to see how cleanly this new program separates the execution of each function from the others to illustrate this furtherwe now extend the main execute function to include request string the string is series of digitsand if the digit from the function name is included in the digit stringthe function prints its name together with the request string before it removes all instances of the digit in question from the request string and passes the request on to the rest of the code for processing in our original contextwe could solve this new requirement as followsdef function_ (in_string)print(in_stringreturn "join([ for in in_string if !' ']def function_ (in_string)print(in_stringreturn "join([ for in in_string if !' ']def function_ (in_string)print(in_stringreturn "join([ for in in_string if !' ']