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
Knowledge of how Microsoft Word toolbars are designed and organized allows the user to learn the program more easily and use it
Anvisha [2.4K]
A. true 

have a great day
4 0
4 years ago
Read 2 more answers
Design an algorithm to generate the sequence of positive integers (In increasing order) whose only prime divisors are 2 and 3.
Natasha2012 [34]

Answer:

es muy buena pero es muy difícil que ni yo pude entender

8 0
3 years ago
If a user visits a web page with an embedded video, leaves without clicking on anything, and the session times out, how will Goo
zimovet [89]

Answer:

As a bounce

Explanation:

The options are:

As an interaction

As a click

As an event

As a bounce

And the correct option is as a bounce. You will find that Google analytics calculates the bounce specifically in terms of a session which gets triggered only as a single plea to the server, and which is the analytics server like the use clicks and opens a certain page on any website, and then exits without making any further request to that server in that session. And hence, this will be counted as a bounce.

7 0
3 years ago
I will mark brainliest (30 points)
kkurt [141]

Answer:

1) <em>it </em><em>should</em><em> </em><em>be </em><em>destroyed</em>

2)<em> </em><em>programing</em><em> </em><em>processes</em>

3) <em>the </em><em>automated </em><em>pattern</em><em> </em><em>the </em><em>viewer's</em><em> </em><em>own </em><em>inputs</em>

4)<em> </em><em>reporter</em>

5) <em>transformative </em>

3 0
3 years ago
8.15 lab*: Program: Playlist​
Ann [662]

Answer:

8.15 LAB* Program: Playlist You Will Be Building A Linked List. Make Sure To Keep Track Of Both The Head And Tail Nodes. (1) Create Three Files To Submit • PlaylistNode. h - Struct Definition And Related Function Declarations • PlaylistNode.

8 0
3 years ago
Other questions:
  • A(n) ____ is a primary key that consists of a column that uniquely identifies an entity, such as a person's social security numb
    14·1 answer
  • The Tab dialog box helps you set tabs in your word processing document. What does this dialog box control the movement of when y
    15·2 answers
  • When long labels are required, which of these commands can you use to improve readability of a worksheet? .
    7·2 answers
  • What advantage does having ultraviolet vision give bees?
    10·2 answers
  • You would like to set up on online meeting to communicate with colleagues on a group project. Which of these tools should you su
    5·2 answers
  • You want to establish the validity of a test designed for computer technicians using a predictive criterion-related validation s
    9·1 answer
  • By
    7·1 answer
  • The Word feature that would allow you to insert fields from an Access database into multiple copies of a Word document is called
    12·1 answer
  • Please help!! I dont need the answer i just need explaining on how to do this!!!!
    9·1 answer
  • HC - AL-Career Preparedness
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!