Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

SQL Database Programming

Authors: Chris Fehily

1st Edition

1937842312, 978-1937842314

More Books

Students also viewed these Databases questions

Question

6. Explain the power of labels.

Answered: 1 week ago

Question

10. Discuss the complexities of language policies.

Answered: 1 week ago