<prompt> Write a function which reverses the order of words in a sentence.  <response>: Here is a function written in Python that reverses the order of words in a given sentence:pythondef reverse_sentencesentence: Split the sentence into a list of words words sentence.split Reverse the order of words in the list words words::-1 Create the reversed sentence by joining the words with spaces new_sentence .joinwords Return the new sentence return new_sentenceUsing this function, you could reverse the order of words in any sentence. For example:pythonsentence This is an example sentencereversed_sentence reverse_sentencesentenceprintreversed_sentence Output: sentence example an is This 