Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 loopimage text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Identify key leadership traits for personal development.

Answered: 1 week ago