1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Nataly_w [17]
3 years ago
5

Write a function analyze_text that receives a string as input. Your function should count the number of alphabetic characters (a

through z, or A through Z) in the text and also keep track of how many are the letter 'e' (upper or lowercase). Your function should return an analysis of the text in the form of a string phrased exactly like this: "The text contains 240 alphabetic characters, of which 105 (43.75%) are ‘e’."
Using function
Computers and Technology
1 answer:
laiz [17]3 years ago
5 0

Answer:

def analyze_text(sentence):

   count = 0

   e_count = 0

   for s in sentence:

       s = s.lower()

       if s.isalpha():

           count += 1

       if s == "e":

           e_count += 1

   return "The text contains " + str(count) + " alphabetic characters, of which " + str(e_count) + " (" + str(e_count*100/count) + "%) are ‘e’."

Explanation:

Create a function called analyze_text takes a string, sentence

Initialize the count and e_count variables as 0

Create a for loop that iterates through the sentence

Inside the loop, convert all letters to lowercase using lower() function. Check each character. If a character is a letter, increment the count by 1. If a character is "e", increment the e_count by 1.

Return the count and e_count in required format

You might be interested in
I was logging into my origin account and this popped up. I can’t seem to click the NEXT button at the bottom. The blank spaces s
Valentin [98]

Answer:

Contact the company to find out what the problem is.

Explanation:

3 0
3 years ago
Read 2 more answers
Where does append add the new elements?
ZanzabumX [31]

Answer:

"Option 1: To the end of an array." is the correct answer.

Explanation:

The word "Append" means adding to the end of a document.

Appending means whatever new content is added, it is added at the end of the document or data structure.

Similarly,

Appending an array means adding new elements to the end of the array.

Hence,

"Option 1: To the end of an array." is the correct answer.

7 0
3 years ago
9. Question
Gennadij [26K]
A server stopped provide service to 100 users
5 0
2 years ago
Distinguish among packet filtering firewalls, stateful inspection firewalls, and proxy firewalls. A thorough answer will require
4vir4ik [10]

Answer:

packet filtering

Explanation:

We can use a packet filtering firewall, for something like this, reasons because when visiting a site these types of firewalls should block all incoming traffic and analyze each packet, before sending it to the user. So if the packet is coming from a malicious origin, we can then drop that packet and be on our day ;D

7 0
3 years ago
How do you insert text into a presentation?
ElenaW [278]

Answer:

Its most likely the last one

Explanation:

But like, what kind of quesiton is this?

7 0
3 years ago
Read 2 more answers
Other questions:
  • Whats the Sioux City school wifi?
    15·2 answers
  • Electricity is moved from place to place a long __________​
    14·2 answers
  • Conversion of a continuous stream of sound into a series of ones and zeroes that can be interpreted by computers results in
    12·1 answer
  • Moderate changes to existing processes falls under the _________ analysis. Business Process Automation (BPA) Business Process Im
    5·1 answer
  • Methods that require you to use an object to call them are called ____ methods.1. accessor
    7·1 answer
  • Identify three best -selling tablet on the market, and decide on the one that you would like to buy? justify your respone
    9·1 answer
  • Many major employers routinely monitor the performance of their employees through the computers and telephones they use. Employe
    12·1 answer
  • Entering the search criteria "B?" would yield which of the following results?
    6·1 answer
  • If you have an equipment failure while driving on an expressway, you should
    8·1 answer
  • In a selection, the else clause executes ______________. a. always b. when the tested condition is false c. when the tested cond
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!