Function In Highlander Kicking My Butt


highlanderName = "mac"

def wordInString(string, word):
    lenString = len(string)
    lenWord = len(word)
    for i in range(0, (lenString - lenWord), + 1):
        for j in range(lenWord):
            if [i + j] != [j]:
                break
            if j == lenWord - 1:
                return True
    return False

I didn’t have any problem with Ice Hunter, which has a very similar function, but I just can’t seem to figure this one out. I get this weird error that doesn’t specify a line and doesn’t mean anything to me. Anyone have any ideas what’s wrong?

ErrorInHighlander01

Nevermind. Finally figured it out.