problem with function

leonardo selmi l.selmi at
Thu Mar 21 19:31:47 CET 2013

hi all,

i wrote the following code:

def find(word, letter):
    index = 0
    while index < len(word):
        if word[index] == letter:
            return index
        index = index + 1
    return -1

if i run the program i get this error: name 'word' is not defined.  how can i solve it?


More information about the Python-list mailing list