Reporting Bug Practice Makes Perfect Censor


#1



I want to report a bug, but I dont know where the right place is. This code should fail to pass, yet it passes just fine.
Uploading...


import re

def censor(text, word):
    for i in text:
        string = re.sub(word, '*' * len(word), text)
    return string
    
text = 'hey hey hey'
word = 'heyl'
print censor(text, word)


#2

the code works fine? It censors when it has to, and doesn't censor when it doesn't have to.

the word you want to censor is heyl, which doesn't occur in text, so everything is fine?


#3

Sorry, I completely forgot I had made this just before. My concern had been adressed in a different question :sweat_smile:


#4