Question: once upon a time in a land far away there was a village where the people lived in harmony with nature. they cultivated their land

once upon a time in a land far away there was a village where the people lived in harmony with nature. they
cultivated their land with care and treated every living being with respect every morning. they woke up to the
melodious chirping of birds and the soothing sound of the river thlat flowed by their village the children played
freely in the meadows and everyone knew each other by name. it was a simple yet fulfilling life away from the chaos
of the outer world as the sun set the village would light up with lanterns and the sound of laughter and music
would fill the air under the starlit sky. they shared stories of the days gone by and dreams of the
future it was indeed a magical place where every day was a celebration of life and togetherness.
Part 3: Programming Questions: String Manipulation (8 pts)
Read the paragraph from the file named story.txt. Then, perform the following operations: 1) Split the string in story.txt into individual sentences.Code in PYTHON
2) Remove any leading or trailing spaces from each sentence.
3) Convert each sentence to start with a capital letter and end with a period.
4) Combine these sentences back into a single string, separated by a space.
5) Write it into another file named new_story.txt
For example, if the content is " hello world. python is fun. i like to code.", the output string should be "Hello world. Python is fun. I like to code."
once upon a time in a land far away there was a

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!