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
Employees don't have to comply with PPE requirements if they feel the PPE isn't necessary for the particular task they performed
ANTONII [103]
You know what...ITS IS VERY VERY FREAKIN FALSE!!
7 0
3 years ago
Read 2 more answers
The Nigerian 4-6-9 scam refers to a fraudulent activity whereby individuals claiming to be from a foreign country will promise a
Serhud [2]

Answer:

<em>b. False</em>

<em></em>

Explanation:

<em>The system of fraud is called 4-1-9 scam</em>. And yes, victims are always promised large sum of money to secretly help in moving a large sum of money.

7 0
3 years ago
13. Place where names, addresses and email information<br> is stored
yanalaym [24]

Answer in ur email

Explanation:

8 0
2 years ago
You need to fax a portion of a map from a large hard-cover atlas to a client from an internal fax-modem. To fax the map, the bes
Kay [80]
The fax modem is used to send and receive fax messages by only having phone line (fax machine is not required). The scanned documents should be saved as digital file (image or PDF format) in order to be sent. So, in order to send a portion of a map you should first convert the map into digital file and than simply send it through the fax modem. The best way to convert it to a digital file is to use an optical character recognition (OCR). 
6 0
3 years ago
If you were teaching a fellow student to use software for the first time and the software had many built-in hotkeys, would you f
Liula [17]

Answer:

Hotkey commands

Explanation:

It would be easier and more efficient in the long run to use hotkeys.

5 0
3 years ago
Other questions:
  • ________ is used to store programs and instructions that are automatically loaded when the computer is turned on.
    14·1 answer
  • Queue is the LIFO structure.<br><br> o True<br><br> o False
    8·1 answer
  • Sabian que hay una violadora sexuar el nombre de usario es SASHENKAFASION me acaba de decir que hackio en donde vivo,mi nombre c
    5·1 answer
  • You are tasked with creating a mileage calculator to calculate the amount of money that should be paid to employees. The mileage
    5·1 answer
  • A(n) __________ item is a hardware or software item that is to be modified and revised throughout its life cycle
    10·1 answer
  • To maintain her audience's confidence in her, what should kiara not do while delivering her presentation?
    10·1 answer
  • Can I use some Company's name in my Research Project. For example, my research is based on E-commerce security and i wanna use A
    14·1 answer
  • A TCP Sender is just about to send a segment of size 100 bytes with sequence number 1234 and ack number 436 in the TCP header. W
    5·1 answer
  • Alfred works in the human resources department, and he uses a management information system to find applicants' résumés on the w
    7·1 answer
  • Discovery of a vulnerability in a software program can potentially be sold to the government. Group of answer choices True False
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!