Censor exercise in Practice Makes Perfect


#1



https://www.codecademy.com/courses/python-intermediate-en-rCQKw/1/4?curriculum_id=4f89dab3d788890003000096


DISREGARD. I FOUND THE ERROR ON THE LINE ABOVE (MISSING ])

All, I'm getting an error on line 18 for incorrect syntax.. It is only an else: I have trippled checked the indentation. What am I missing?


def censor(text,word):
    result=''
    print len(word)
    print text[3]
    print len(text)
    myCount=0
    for i in range(len(text)-len(word)+1):
        print i
        print myCount
        if text[i:i+len(word)]==word and myCount<=0:
            result+='*'*len(word)
            myCount=len(word)-1
        elif myCount<=0:
            result+=text[i]
            myCount-=1
        elif i==len(text)-len(word)+1:
            result+=text[i,i+len(word+1)
        else:
            myCount-=1
    return result

print censor('what the fudge is that','fudge')


#2