Shortcut to initialize variables

Andrew aetodd at
Fri Jun 17 20:24:11 CEST 2005

Newb here... For one of my programs I want to initialize a variable for
each letter of the alphabet. For example, a,b,c = 0,0,0. I don't think
this works, but I'm wondering if I can do something similar to this:

from string import ascii_lowercase

class Blah:
    def __init__(self):
        for letter in ascii_lowercase:

Is there a way I can do something like this without using classes?


More information about the Python-list mailing list