what if I don't want to use .split function, in fact it doesn't work for situations like strings do not have blank space in between.
If so, .split won't work
please advise, how should I revise my code in below or how should i continue finishing it, thanks.
(I thought about this quesitons for 2 days in total, over the weekend
def censor(text, word): l = len(text) w = len(word) for i in range(l): if text[i] == word: for j in range(w): if text[i+1+j] == word[j+1]: continue else: break Share with all of you another two versions of censor practice, with use of .split '''def censor(text, word): wordList = text.split() result =  print wordList for w in wordList: if w == word: result.append( "*"*len(word)) else: result.append(w) return " ".join(result)''' '''def censor(text, word): wordList = text.split() print wordList for w in wordList: if w == word: wordIndex = wordList.index(w) wordList[wordIndex] = "*"*len(word) return " ".join(wordList)'''