model-view-controller pattern return names def write_name(filenamename)with open(filenameget_append_write(filename)as data_filedata_file write("{}\nformat(name)def get_message(name)if name ="lion"return "rrrrrrrroar!if name_in_file('names dat'name)return "welcome back {}!format(namewrite_name('names dat'namereturn "hi {}it is good to meet youformat(namedef main(name)print(get_message(name)if __name__ ="__main__"main(sys argv[ ]nowwe finally begin to see another pattern appear what we have here are three distinct types of functionswhich are the result of separating the concerns as much as we can we end up with code that deals with getting the greeting to returncode writing the greeting to the consoleand some code to handle the flow of the programsending the relevant requests to the data-retrieval codegetting the greetingand sending that to the code that ultimately displays it on the console model-view-controller skeleton in general termswe want to capture the pattern discussed in the previous paragraph in reusable pattern we also want to bake the open-closed principle into the codeandto that endwe want to encapsulate key parts of the program in objects before anything can happenour program must receive some form of request this request must be interpreted and then kick off the relevant actions all of this happens inside an object that exists solely for controlling the flow of the program this object handles actions like requesting datareceiving dataand dispatching responses to the