Question: implement a function that takes a string consisting of words separated by single spaces and returns a string containing all those words but in the

implement a function that takes a string consisting of words separated by single spaces and returns a string containing all those words but in the reverse order and such that all cases of letters in the original string are swapped, i.e. lowercase letters become uppercase and uppercase letters become lowercase.Examplesentence = "rUns dOg"Reverse the word order and swap the case of all letters, then return the string "DoG RUNS".Function descriptionComplete the function reverse_words_order_and_swap_cases in the editor below.The function has the following parameter(5):string sentence: a given string of space-separated wordsReturns:string: a string containing all the words from the sentence but in the reverse order and such that all cases of letters in the sentence string are swapped.Constraints sentence contains only English letters and spaces. sentence begins and ends with a letter. There are no two consecutive spaces in sentence. There are at most 10 words in sentence. The lengths of each of the words is at most 10.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!