Question: Problem Statement: Write a function called summarize _ text ( ) that accepts a multi - line string ( representing a passage ) as an

Problem Statement:
Write a function called summarize_text() that accepts a multi-line string (representing a passage) as an
input and returns a summary of the text in a dictionary. The summary should include:
1. The total number of characters.
2. The total number of words.
3. The total number of sentences.
4. The most common word and its frequency (if there are multiple most common words, just
return one of them)
Specifications:
Input: A multi-line string.
Output: A dictionary with the following keys:
o "total_characters": Total number of characters in the text (excluding spaces).
o "total_words": Total number of words.
o "total_sentences": Total number of sentences (you can assume sentences end with .,!,
or ?).
o "most_common_word": The most common word (ignoring case)

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!