subject

Write a function named count_letters that takes as a parameter a string and returns a dictionary that tabulates how many of each letter is in that string. the string can contain characters other than letters, but only the letters should be counted. the string could even be the empty string. lower-case and upper-case versions of a letter should be part of the same count. the keys of the dictionary should be the upper-case letters. if a letter does not appear in the string, then it would not get added to the dictionary. the dict and count function may not be used. for example, if the string is```"aabb"```then the dictionary that is returned should contain these key-value pairs: ```{'a': 2, 'b': 2}so far i am stuck at(which is not working correctly when given to capitalized values, ex "aa" returns 1): def count_letters(string): letter_dic = { } for letter in string: if letter in letter_dic: letter_dic[letter] = +1 else: letter_dic[letter] = 1 return letter_dic

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 15:10
Awould be a misconfiguration of a system that allows the hacker to gain unauthorized access, whereas is a combination of the likelihood that such a misconfiguration could happen, a hacker’s exploitation of it, and the impact if the event occurred.
Answers: 3
question
Computers and Technology, 22.06.2019 16:20
It policy compliance and emerging technologies respond to the following: propose at least three control measures that organizations need to put in place to ensure that they remain complaint with emerging technologies and in a continually changing it environment. examine the correlation of effective configuration management and change control procedures to remain compliant with emerging technologies and it security changes.
Answers: 2
question
Computers and Technology, 23.06.2019 06:30
Which option correctly describes a dbms application? a. software used to manage databases b. software used to organize files and folders c. software used to develop specialized images d. software used to create effective presentations
Answers: 1
question
Computers and Technology, 24.06.2019 11:00
Each row in a database is a set of unique information called a(n) ? a.) table. b.) record. c.) object. d.) field.
Answers: 2
You know the right answer?
Write a function named count_letters that takes as a parameter a string and returns a dictionary tha...
Questions
question
Mathematics, 20.02.2020 17:22
Questions on the website: 13722363