I need to create a dictionary, values could be left blank or zero but i need the keys to be all the possible combinations of ABCD characters with lenght k. For example, for k = 8
lex = defaultdict(int)
lex = {
'AAAAAAAA':0,
'AAAAAAAB':0,
'AAAAAABB':0,
...}
so far i have tried somethink like this, i know it's wrong but i have no idea how to make it work, i'm new in python so please bear with me.
mydiction = {}
mylist = []
mylist = itertools.permutations('ACTG', 8)
for keys in mydiction:
mydiction[keys] = mylist.next()
print(mydiction)