Question: Python Please complete using for loop Message Encoder Function Name: messageEncoder Parameters: message ( string ) Returns: encoded_message ( string ) Description: Write a function

Python

Please complete using for loop Python Please complete using for loop Message Encoder Function Name: messageEncoder

Message Encoder Function Name: messageEncoder Parameters: message ( string ) Returns: encoded_message ( string ) Description: Write a function that takes in a message and outputs this message with the words at every other position beginning with the first one in upper case, and every other word in between in lower case. That is, the first word should be upper case, the second word lower case, the third word should be upper case, and so on. If the string passed in is the empty string, the function should return None. Hint: The string methods .lower() and .upper() might be useful. lower() ignores all punctua- tion to return a string with every letter in lowercase. upper() likewise ignores punctuation to return a string's uppercase representation. >>> message = "I woke up, couple mil on my plate" >>> print(messageEncoder (message)) I woke UP, couple MIL on MY plate >>> message = "I just went gave my mama a hundred" >>> print(messageEncoder (message)) I just WENT gave My mama A hundred

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!