Censor ... My code is correct but I still recieve an error message


#1



My code is correct but it still says I am doing it wrong .. what do u think should I do ?


`python
def censor(text,word):
VAE=len(word)
VAR=0
JAR=[]
for i in range(0 , len(text.split())):
JAR.append(text.split()[i])
JAR.append(" ")
for index in range(0, len(JAR)):
if JAR[index] == word:
JAR[index]= "*" * VAE
return "".join(JAR)


#2

That certainly will not run, perhaps you posted something different from what you're running yourself, that's a problem if it's that other code that you wish to discuss.

If you're asking about an error message, then you will need to include that error message, just the fact that it exists doesn't contain the information of what it is saying. If at all possible, then also explain how to reproduce that, because a problem that can't be reproduced is not a problem, because it doesn't happen.


#3

Thanks for reply I actually Fixed it .. I just had to delete an empty space at the end of the sentence and Voila ! :slight_smile:

Thanks alot though


#5

2 posts were split to a new topic: Censor


#7