Answered step by step
Verified Expert Solution
Question
1 Approved Answer
python Function Name: messageEncoder Parameters: message ( string ) Returns: encoded_message ( string ) Description: Write a function that takes in a message and outputs
python
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 hundredStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started