I am working on the Censor activity in the unit Practice Makes Perfect.
This is my code:
text = text.split()
new_text = ""
for item in text:
if word == item:
for i in item:
new_text += "*"
new_text += " "
new_text += "%s " % item
print censor(“hey holla hey hey”,“hey”)
The code works perfectly when I test it but the activity will not complete, it is giving me this error:
Your function fails on censor(“hey hey hey”,“hey”). It returns " " when it should return " ".
I do not know what I am doing wrong since the code is working when I test it but the activity won’t mark as complete.
Apparently the code formatting did not copy over, here is the code in paste bin: