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, 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 15:20
What does a bonus object do? a. subtracts lives b. keeps track of a player's health c. gives a player an advantage d. makes text appear
Answers: 1
question
Computers and Technology, 23.06.2019 15:30
The processing of data in a computer involves the interplay between its various hardware components.
Answers: 1
question
Computers and Technology, 24.06.2019 07:50
Write a defining table and then a program that determines if you can sleep in or not. your program should get all its input from your computer’s clock. on all weekdays (monday through friday) that are not holidays, your program should output “get up! ” on all other days (weekends and holidays), your program should output “sleep in.” the three holidays that your program must check for are january 1 (new year’s day), july 4 (u.s. independence day), and december 25 (christmas). you don’t need to include other holidays in your program because most other holidays do not occur on a fixed day each year.
Answers: 1
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, 22.11.2019 08:31
question
Mathematics, 22.11.2019 08:31