Question: In Python Your team is scrambling to decipher a recent message, worried it's a plot to break into a major European National Cake Vault. The
In Python
Your team is scrambling to decipher a recent message, worried it's a plot to break into a major European National Cake Vault. The message has been mostly deciphered, but all the words are backwards! Your colleagues have handed off the last step to you.
Write a function reverse_words() that takes a message as a list of characters and reverses the order of the words in-place

Why a list of characters instead of a string? The goal of this question is to practice manipulating strings in place. Since we're modifying the message, we need a mutable. type like a list, instead of Python's immutable strings For example: Pythonv messageC a, k' 'e,'', reverse words (message # Prints: . steal pound cake' print "" join(message) When writing your function, assume the message contains only letters and spaces and all words are separated by one space
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
