problem with function

leonardo selmi l.selmi at icloud.com
Thu Mar 21 14:31:47 EDT 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?

thanks!


More information about the Python-list mailing list