Question
Write a program to conduct a special task. There is a paragraph, which has been consolidated word-by-word into a list called word_ls. Your program should
Write a program to conduct a special task. There is a paragraph, which has been consolidated word-by-word into a list called word_ls. Your program should join any two adjacent words in order and return something in the expected output below (based on the sample paragraph). Noted that your program should be applicable when the content of the paragraph list changes (i.e., when word_ls changes baesd on the content of a new paragraph, your program should still work).
Sample paragraph:
"My name is Lance Chris. I am working at Savings Limited in Germany. Savings Limited accepts mutual funds as investment option. Savings Limited also accepts other investment option."
The word list form:
word_ls = ['My', 'name', 'is', 'Lance', 'Chris', 'I', 'am', 'working', 'at', 'Savings', 'Limited', 'in', 'Germany', 'Savings', 'Limited', 'accepts', 'mutual', 'funds', 'as', 'investment', 'option', 'Savings', 'Limited', 'also', 'accepts', 'other', 'investment', 'option']``` Expected output:
['My name', 'name is', 'is Lance', 'Lance Chris', 'Chris I', 'I am', 'am working', 'working at', 'at Savings', 'Savings Limited', 'Limited in', 'in Germany', 'Germany Savings', 'Savings Limited', 'Limited accepts', 'accepts mutual', 'mutual funds', 'funds as', 'as investment', 'investment option', 'option Savings', 'Savings Limited', 'Limited also', 'also accepts', 'accepts other', 'other investment', 'investment option'] ```
Step 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