About this blog

I feel this blog as a reflection of my thoughts to myself , and sometimes as a public diary, and the is my only friend to share my thoughts who says never a "oh no! ,you shouldn't....That is boring...."

Python code for searching a word from ubuntu english dictionary

testvar=raw_input("Ask user for a search word:")

textfile=open("/usr/share/dict/words","r")
lines=textfile.readlines()
lines=[lnes.strip('\n') for lnes in lines]
for x in range(len(lines)):
if lines[x]==testvar:
print 'found at ',x
break

కామెంట్‌లు లేవు: