Letter Counter Project Help
Greetings, I have already looked up answers to this, but I don't want to copy & paste because I don't even get the answers. Please help me modify my wretched code into something feasible, so that I'll understand what's going on. ... Problem: Given a string as input, you need to output how many times each letter appears in the string. You decide to store the data in a dictionary, with the letters as the keys, and the corresponding counts as the values. Create a program to take a string as input and output a dictionary, which represents the letter count. Sample Input hello Sample Output {'h': 1, 'e': 1, 'l': 2, 'o': 1} ... The best code that I have mustered is the following: text = input() dict = {} y = list(text) z = y.count(text) a = {z : y} print(a) """ Input awesome Your Output {0: ['a', 'w', 'e', 's', 'o', 'm', 'e']} ... How would you correct my existing code? Much appreciated, Abraham