<prompt> Write a code that matches the following output.Input: 5,9,2,7Output: 2,5,7,9  <response>: pythondef sort_listinput_list: output_list sortedinput_list return output_listinput 5,9,2,7output sort_listinputprintInput:, inputprintOutput:, outputThis code takes in a list of unsorted numbers as input and returns the sorted list as the output. The sorted function is used to sort the input list in ascending order. The input and output lists are printed to match the desired format. 