Hi I have this code currently:
dict = open("dict.txt", "r").readlines()
print dict
LETTERS={'a':1, 'b':2, 'c':3, 'd':4, 'e':5, 'f':6, 'g':7, 'h':8, 'i':9, 'j':10, 'k':11, 'l':12, 'm':13, 'n':14, 'o':15, 'p':16, 'q':17, 'r':18, 's':19, 't':20, 'u':21, 'v':22, 'w':23, 'x':24, 'y':25, 'z':26}
word_value=0
lettersv=[]
letterss=[]
def main():
word=raw_input('what is the word?')
word=word.lower()
for i in range(len(dict)):
dict[i] = dict[i][0:len(dict[i])-2]
if word in dict:
for letter in word:
lettersv.append(LETTERS[letter])
letterss.append(letter)
print '*'*40
print letterss
print '*'*40
word_value=sum(lettersv)
print lettersv, word_value
print '*'*40
else:
print "that word is not in the english dictionary, sorry."
while 1:
main()
but whenever I try to test, it wont recognise words like 'english' Does anyone know how to fix this? thanks in advance.