Question: Write a python program that modifies the words in a string variable. Create string variable and assign a sentence. Example: aString = Michelle ma belle
Write a python program that modifies the words in a string variable. Create string variable and assign a sentence. Example: aString = "Michelle ma belle these are words that go together well" {Ref: The Beatles} Your program should generate another string variable and print it. The modifications should be as follows 1 - odd indexed (1st 3rd 5th etc.) words should be converted to upper case 2 - even indexed (2nd 4th 6th etc.) words should be reversed, the output would be as follows bString = "MICHELLE am BELLE eseht ARE sdrow THAT og TOGETHER llew " You can use user - defined functions if you need or you can write your program without any user - defined functions
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
