<prompt> Write a function to reverse the order of a list.list1 10, 20, 30, 40  <response>: Here is one way to write a function that reverses the order of a list:pythondef reverse_listmy_list: return my_list::-1list1 10, 20, 30, 40reversed_list reverse_listlist1printreversed_listThis function uses Pythons slicing syntax to return a new list that contains all the elements of the original list, but in reverse order. You can then call this function with your input list list1, and it will return a new list with the original elements reversed. In this example, the output would be 40, 30, 20, 10. 