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
When saving a memo you created in Word, which of the following extensions is automatically assigned to the document?
Lena [83]
.docx is the default file extension on a Word doc.
6 0
3 years ago
Read 2 more answers
Another one please help quick i got to go soon
astraxan [27]

Answer:

no

Explanation:

yellow: the last sentence in the text

blue: Queenies flowers reached for the sky

Personification means that you apply human characteristics to things that are not alive, like a flower smiling, a term used when people see a field of healthy flowers

7 0
2 years ago
What piece of equipment is NOT a tool that would be considered appropriate equipment for on-site visits? a. multimeter b. flashl
Anton [14]

The oscilloscope is NOT a tool that would be considered appropriate equipment for on-site visits. The oscilloscope is an electronic test instrument used to observe observation constantly varying signals. This instruments is used in laboratories, and not on-site visits.

All other instruments are moveable and can be used on-site.


3 0
3 years ago
You may save more money by using a a0 service, but you will spend more time on creating a contract.
Anon25 [30]

Answer:

contractor management outsourcing

Explanation:

For any recruiter, two things are important. They want to ensure more time, and hence more money. By the time I mean, they want to avoid investing time in something that does not generate revenues. And unfortunately, there exists a bundle of such irrelevant, and yet must-do activities which we need to perform. However, if we opt for contractor management outsourcing to a better management employment relationship, we save a lot of time and earn more as a recruiter. However, we then spend more time creating a contract, as even a single faulty clause can be hard for you to engulf in the future. And that is why it requires more time. However, the good part is, we as a recruiter are happy by the end of the day, as we earn more profit. And it's due to better resource and time management.

3 0
3 years ago
Write an algorithm to create a customer’s bill for a company. The company sells only five different products. TV, VCR, Remote Co
alukav5142 [94]

Answer:

so

tv= 400$

VCR= $220

remote controller= $35

CD Player= $280

Tap recorder= $90

so total = $1025 total

here 8% sale tax increase so is 82$ so

1025-82$ = 943 total amount

increase or decrease tax according to your question :)

6 0
3 years ago
Other questions:
  • "the file that specifies how netbeans builds and deploys the application when you run the application is called the ____________
    8·1 answer
  • When cleaning a firearm, what end of the firearm should you generally clean from?
    11·2 answers
  • An expression involving byte, int, and literal numbers is promoted to which of these?
    12·1 answer
  • The system partition is the partition that contains the files required to load the operating system (bootmgr, and BCD). The syst
    9·1 answer
  • How many total cells can a worksheet window contain? If columns are labelled alphabetically, what will be the label for the cell
    15·1 answer
  • Icon view, list view, and details view are all common views provided by which kind of program?
    12·2 answers
  • Raw materials have two basic types what are the 2?
    11·2 answers
  • Design an Application called Student Course Management create interface called Student Course add an abstract method called ad C
    10·1 answer
  • A toolbar of round buttons that appear when you move the mouse when in Slide Show view id called ____________.A toolbar of round
    8·1 answer
  • Define a function that will return the length of a list
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!