Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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_2

Step: 3

blur-text-image_3

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

Database Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

10th Edition

0137916787, 978-0137916788

More Books

Students also viewed these Databases questions

Question

In an Excel Pivot Table, how is a Fact/Measure Column repeated?

Answered: 1 week ago