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
A project manager type a document and print it he is using
IRINA_888 [86]
He is using a Computer to type out the document, and a Printer for printing the document.
Thank you!
3 0
3 years ago
You can access various sites on the WWW by using hyperlinks or by______. A. entering a key word for your search B. following dir
saw5 [17]
The correct answer is C
8 0
3 years ago
Read 2 more answers
How do i unblock a website on a school computer if a school blocks it?
tresset_1 [31]

Answer:

look up ultrasurf and just follow the thingy and it will download a vpn ive had it on my computer for a fat min

Explanation:

4 0
2 years ago
someone please please help with this we have to make a sketch of a hydraulic spreader or cutter I chose the spreader now we have
AnnyKZ [126]

Answer:

heueururjrurh the best time to meet Vs t and get the use and may contain briy the best you had any y I have the same time ❤️ ry HR y regards Umesh he was a pleasure to have a great trip and u it

Explanation:

dgsisbsjdudb and I have a nice day best wishes for a few weeks back and I will send you an email from your NVR

8 0
3 years ago
A student is helping a friend with a home computer that can no longer access the Internet. Upon investigation, the student disco
Firlakuza [10]

Answer:

Option (D) is the right answer.

Explanation:

DHCP term used as a short form of dynamic host configuration protocol, which is used to assigns the IP address automatically according to the network.

According to the scenario, the system is getting the wrong IP address that resulting in internet disconnection which is a failure of the DHCP server because it is responsible for assigning the right IP address to the system.

Hence option (D) is the most appropriate answer.

While other options are wrong because of the following reasons:

  • Static IP is the type of IP address which is fix and doesn't change in the system after rebooting, hence it has no connection in the change of IP address.
  • If the DHCP server is working well there is no chance of interference from the surrounding device.
  • Network setting has no connection with computer power supply as SMPS is used to give power and boot system only.
8 0
3 years ago
Other questions:
  • An ______ is a simplified image. [4 letters]​
    7·2 answers
  • Over time, attackers have had to increase their skills to be able to attack systems or create viruses. True False
    8·1 answer
  • Multiple Choice
    6·1 answer
  • __________ was awarded the Nobel Prize in physics forhis work on the photoelectric effect.
    13·1 answer
  • "Consideration of being digitally" literate Means to produce digital technology Participate in digital activities none of the ch
    11·1 answer
  • An automated service that consolidates and distributes information from newsgroups, blogs, forums and news websites is called
    11·1 answer
  • Do you think that distributed OSs use a process-communication technique different from that used by desktop OSs?
    13·1 answer
  • Select the correct answer.
    15·2 answers
  • Who plays Rblx?? What do yall play?
    9·2 answers
  • Write a program that uses a dictionary to store students birthdays. Your program should ask the user what their name is, and loo
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!