b = len(s)
i = 0
d = dict()
k = s[i:i+2]
while i < (b - 1):
if k not in d:
d[k] = 1
i = i + 1
return d
but the loop is not doing the "i=i+1", so all it is doing is printing out the first bigram with '1' next to it.
how can i get all the bigrams in the phrase to show up???
This post has been edited by yeeeboy82: 29 November 2008 - 01:06 PM

New Topic/Question
Reply




MultiQuote


|