Script not printing word count
I have a script to find the word repetition in alist:
newm = [u'life', u'selection', u'squire', u'naturalist', u'patriarch',
u'home', u'man', u'public', u'nbsp', u'born', u'naturalist', u'theory',
u'selectionbecame', u'foundation', u'country', u'gentleman',
u'suggesting', u'class', u'time', u'death', u'evolutionary', u'imagery',
u'ofscience', u'literature']
print newm
#count for list
counts = defaultdict(int)
print "uyti"
for x in newm:
counts[x]+=1
print counts
This program does not even print "uyti". What is the error?
No comments:
Post a Comment