Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Without importing libraries, write a python function that counts how many words there are in a text, excluding numbers and special characters. For example,

1. Without importing libraries, write a python function that counts how many words there are in a text, excluding numbers and special characters. For example, if the text is "Hello everyone, I hope you are enjoying your day everyone! %^& 4"

the output should be :

Your text has: 10 words

2. without importing libraries, write a python function that counts how many times each word was repeated in the text.

The output should be:

Hello: repeated 1 times

everyone: repeated 2 times

i: repeated 1 times

hope: repeated 1 times

you: repeated 1 times

are: repeated 1 times

enjoying: repeated 1 times

your: repeated 1 times

day: repeated 1 times

3. without importing libraries, write a python function that gives the top letter in terms of occurences and how many occurences there are, excluding numbers and special characters. If there is a tie, the function should give you both of the letters

The output should be

The letter that is repeated the most is the letter: e, repeated 10 times

if there was a tie, it should be

The letter that is repeated the most is the letter: e,i repeated 10 times

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_step_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions