Question: Write a Python program that works as a text manipulation tool. The paragraph of text that it will manipulate is: Python is an excellent choice

Write a Python program that works as a text manipulation tool. The paragraph of text that it will manipulate is:
"Python is an excellent choice as a first programming language to learn for a multitude of reasons. Its simplicity and readability make it approachable for beginners, with a clean and concise syntax that minimizes the learning curve. Python's versatility is another key advantage, as it can be used in various domains, from web development and data analysis to scientific computing and artificial intelligence."
Perform the following tasks on this paragraph:
Split the paragraph into a list of words.
Print the number of words.
Print only the first and last word.
Turn the first word into lowercase and the last word into uppercase.
Print the first and last word again to check that your changes worked.
Put the words back together into a paragraph.
Find the first occurrence of the word Python. Write a comment explaining why the result is not 0.
Count how many times the word and appears in the paragraph.
Replace all occurrences of and with &.
Print the whole paragraph to check that all of the previous changes worked.
Split the paragraph into a list of sentences.
Hint: You can use the '.' as the delimiter but when you do that, it will delete the periods. You must go back in and use a for loop to add a period back to the end of each sentence except for the last one.
Print the number of sentences.
Print only the second sentence from the list.
Convert the first and last sentences to all uppercase and then print them.
Reverse the order of the sentences.
Join the sentences from step c back into a paragraph.
Print the final paragraph.
When your program runs, it should match the expected output below exactly. Go back in and put in labels and line breaks as needed.
If you get stuck on any part of this problem, read up on the following Python functions/methods: len(), lower(), upper(), join(), find(), count(), replace(), split(), and reverse()

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 Databases Questions!