Write a Python program that works as a text manipulation tool. The paragraph of text that it will manipulate is: "Python is a high-level, general-purpose programming language. It was created by Guido van Rossum and first released in 1991. Python's design philosophy emphasizes code readability with its notable use of significant indentation. Its language constructs and object-oriented approach aim to help programmers write clear, logical code for small and large-scale projects." Perform the following tasks on this paragraph: 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 list. Print only the first and last sentence from the list. Convert the first and last sentences to all uppercase and then print them. Join the sentences from step c back into a paragraph. Print this final paragraph. Using string slicing, print only the first 20 characters of the final paragraph. Count how many times the word 'code' appears in the final paragraph and print this count. Find the index of the first occurrence of the word 'Python' (case sensitive) in the final paragraph and print this index. Replace all occurrences of 'Python' (case sensitive) in the paragraph with 'PY'. Print the final paragraph. For the last sentence in the paragraph, split the sentence into words, reverse the order of the words, and then join them back together into a sentence. Print this reversed sentence. When your program runs, it should match the expected output below exactly. Go back in and put in labels and line breaks as needed. Im having trouble getiing the sentances to split with a period at the end.
Write a Python program that works as a text manipulation tool. The paragraph of text that it will manipulate is: "Python is a high-level, general-purpose programming language. It was created by Guido van Rossum and first released in 1991. Python's design philosophy emphasizes code readability with its notable use of significant indentation. Its language constructs and object-oriented approach aim to help programmers write clear, logical code for small and large-scale projects." Perform the following tasks on this paragraph: 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 list. Print only the first and last sentence from the list. Convert the first and last sentences to all uppercase and then print them. Join the sentences from step c back into a paragraph. Print this final paragraph. Using string slicing, print only the first 20 characters of the final paragraph. Count how many times the word 'code' appears in the final paragraph and print this count. Find the index of the first occurrence of the word 'Python' (case sensitive) in the final paragraph and print this index. Replace all occurrences of 'Python' (case sensitive) in the paragraph with 'PY'. Print the final paragraph. For the last sentence in the paragraph, split the sentence into words, reverse the order of the words, and then join them back together into a sentence. Print this reversed sentence. When your program runs, it should match the expected output below exactly. Go back in and put in labels and line breaks as needed. Im having trouble getiing the sentances to split with a period at the end.
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
- Write a Python program that works as a text manipulation tool. The paragraph of text that it will manipulate is:
"Python is a high-level, general-purpose
- Perform the following tasks on this paragraph:
- 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 list.
- Print only the first and last sentence from the list.
- Convert the first and last sentences to all uppercase and then print them.
- Join the sentences from step c back into a paragraph.
- Print this final paragraph.
- Using string slicing, print only the first 20 characters of the final paragraph.
- Count how many times the word 'code' appears in the final paragraph and print this count.
- Find the index of the first occurrence of the word 'Python' (case sensitive) in the final paragraph and print this index.
- Replace all occurrences of 'Python' (case sensitive) in the paragraph with 'PY'. Print the final paragraph.
- For the last sentence in the paragraph, split the sentence into words, reverse the order of the words, and then join them back together into a sentence. Print this reversed sentence.
- When your program runs, it should match the expected output below exactly. Go back in and put in labels and line breaks as needed.
- Im having trouble getiing the sentances to split with a period at the end.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 4 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education