10/15 censor


#1

def censor(text,word):
ctext=""
text_sp=string.split(text)
for i in text_sp:
if i==word:
ctext.append(""4)
else:
ctext.append(i)
return ctext
censor("this hack is wack hack","hack")

Problem:
Oops, try again. Did you create a function called censor? Your code threw a "global name 'string' is not defined" error.

I dont understand.
Please help me. Thank you, folks.


#2

string is not defined anywhere neither do you have any module called string defined.
perhaps you wanted to do text.split()