我目前正在解决“审查”的形式孰能上CodeAcademy了Python当然完美。的Python - CodeAcademy:审查
但是我面对错误,我不知道如何解决此问题。我多次查看我的代码,我无法理解错误。
这里是我的代码:
def censor(text, word):
text = text.lower()
word = word.lower()
word_censored = '*' * len(word)
textlist = text.slip()
newtextlist = []
for stuff in textlist:
if stuff == word:
newtextlist.append(word_censored)
else:
newtextlist.append(stuff)
return "".join(newtextlist)
这显示了是错误:
Oops, try again. Your code looks a bit off--it threw a "'str' object has no attribute 'slip'" error. Check the Hint if you need help!
能有人给什么是错的提示吗? 谢谢!
那么,你做的事'slip'功能呢? –
是不是把字符串的所有单词都列出来并列出来? –
不,这将是'分裂'。 –