Code: Alles auswählen
i=0
for k in range(0, (len(res)-15)):
for x in res[k:k+14]:
if res[k+7][1]==x[1]:
i+=1
break
Ich habe diese Liste, die ich der Variable res zuweise (in Wirklichkeit ist die Liste wesentl. länger).
- [('what', 'WP'), ('you', 'PP'), ('deserve', 'VVD'), ('the', 'DT'), ('skull', 'NN'), ('turn', 'VVD'), ('my', 'PP$'), ('stomach', 'NN'), ('but', 'CC'), ('the', 'DT'), ('other', 'JJ'), ('be', 'VBD'), ('bad', 'JJR'), ('those', 'DT'), ('ankle', 'NNS'), ('cut', 'VVD'), ('neatly', 'RB'), ('off', 'RB'), ('to', 'TO'), ('fit', 'VV'), ('Matt', 'NP'), ('Fenner', 'NP'), ("'s", 'POS'), ('castaside', 'NN'), ('coffin', 'NN')]
Frage:
Liege ich richtig oder muss ich das anders machen?