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
vaieri [72.5K]
3 years ago
5

Use a dictionary to count the frequency of letters in the input string. Only letters should be counted, not blank spaces, number

s, or punctuation. Upper case should be considered the same as lower case. For example, count_letters("This is a sentence.") should return {'t': 2, 'h': 1, 'i': 2, 's': 3, 'a': 1, 'e': 3, 'n': 2, 'c': 1}.
Computers and Technology
1 answer:
netineya [11]3 years ago
4 0

Answer:

def count_letters(text):

 result = {}

 # Go through each letter in the text

 convert_text = text.lower()

 for letter in convert_text:

   if letter.isalpha():

     if letter in result:

       result[letter] += 1

     else:

       result[letter] = 1

 return result

print(count_letters("AaBbCc"))

# Should be {'a': 2, 'b': 2, 'c': 2}

print(count_letters("Math is fun! 2+2=4"))

# Should be {'m': 1, 'a': 1, 't': 1, 'h': 1, 'i': 1, 's': 1, 'f': 1, 'u': 1, 'n': 1}

print(count_letters("This is a sentence."))

# Should be {'t': 2, 'h': 1, 'i': 2, 's': 3, 'a': 1, 'e': 3, 'n': 2, 'c': 1}

Explanation:

You might be interested in
What is the synonym for term port?
Rus_ich [418]
The synonym for term port is seaport

3 0
3 years ago
An independent penetration testing company is invited to test a company's legacy banking application developed for Android phone
LenaWriter [7]

In the case above, the company can prevent this from happening in the public Internet through the Use certificate pinning.

<h3>Should a person use certificate pinning?</h3>

Mobile applications are known to be one that often make use of   certificate or also public key pinning so that they can be able to make sure that communications are secure.

Hence it is one that  is often implemented if  the developer of the application is said to be require to validate the remote host's identity or if operating in a harsh environment.

Hence, Certificate pinning hinders which certificates are considered valid for a any kind of website,  and as such, In the case above, the company can prevent this from happening in the public Internet through the Use certificate pinning.

Learn more about certificate from

brainly.com/question/1874937

#SPJ1

4 0
2 years ago
Iglesias intends to use a word processing program to create a web page. Which of these options should Iglesias use?
Murrr4er [49]
He should view the Outline THEN the Layout and finally preview in web browser.
6 0
3 years ago
A circular copper disk of diameter D=10 cm rotates at frequency =1800 rev/min about an axis through its center and at right angl
MAXImum [283]

Answer:

Induced current is 0.226 A

Explanation:

To calculate potential difference we have

E =1/2Bomega*r2 =1/2*1*1800*3.14*0.05=141.3

putting values we get

the p.d is 141.3

7 0
3 years ago
An array similar to a phone book has 1000 names arranged as names [0], names[1]....names[999]. Nancy wants to search a name X in
sammy [17]

Answer:

b. The names in the list should be in alphabetical order.

Explanation:

A binary search is an algorithm used for searching for an item in a list or array. The algorithm first sorts the data structure into order and then divides it into halves. If the searched item is less than the middle item in the list, then the algorithm searches for the target in the first half, else, in the second half. This reduces the time complexity of the search.

5 0
3 years ago
Other questions:
  • Timing circuits are a crucial component of VLSI chips. Here’s a simple model of such a timing circuit. Consider a complete balan
    10·1 answer
  • Write the following function without using the C++ string class or any functions in the standard library, including strlen(). Yo
    12·1 answer
  • How do I download the Microsoft word on my Hp probook
    8·2 answers
  • Select a classification for File2 so that: Alice can read and write to File2 Bob and Charlie can write to File2, but can't read
    6·1 answer
  • What does the merge &amp; center button in the alignment group on the home tab do?
    8·1 answer
  • EIPP:________.
    9·2 answers
  • Jorge is looking for information about the life of his favorite music artist, Ray Charles. Which type of resource(s) would provi
    13·1 answer
  • Write an application that displays the strings in the provided array alphabetically in ascending order.
    9·1 answer
  • 1: define about information system in computer?
    10·1 answer
  • Which is an example of a demand account
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!