I want to generate a dict with the letters of the alphabet as the keys, something like
letter_count = {\'a\': 0, \'b\': 0, \'c\': 0}
what
very easy with dictionary comprehensions : {chr(i+96):i for i in range(1,27)}
generates :
{'a': 1, 'c': 3, 'b': 2, 'e': 5, 'd': 4, 'g': 7, 'f': 6, 'i': 9, 'h': 8, 'k': 11, 'j': 10, 'm': 13, 'l': 12, 'o': 15, 'n': 14, 'q': 17, 'p': 16, 's': 19, 'r': 18, 'u': 21, 't': 20, 'w': 23, 'v': 22, 'y': 25, 'x': 24, 'z': 26}
You can generate the same for Capital A-Z with chr(i+64)