D is a list containing some words. D=[word1,word2,word3......]
E is a list containing combinations of any two words in D ... E=[(word1,word2),(word7,word1)....]
How can I implement the following in python:
A0[x]=1 for all x in D # This is actually Ai. when i=0, it becomes A0
B0[x]=1 for all x in D
for i = 1 to 10: # i takes the values 1 to 10
Ai[x]=0 for all x in D
Bi[x]=0 for all x in D
for x in D:
for y in D:
if (x,y) in E:
Bi[x]=bi[x] + Ai-1[q]
if (y,x) in E:
Ai[p]=Ai[p]+Hi-1[q]
print A10,B10