I did solve it using my own way, as follows:
def censor(text,word): newLst= for i in text: newLst.append(i) print newLst for i in range(len(text)): if text[i:i+len(word)]==word: for n in range(len(word)): newLst[i+n]="*" return "".join(newLst)
but when I checked the hint to see what codecademy’s method was, I couldn’t figure out all the steps…
(was .split() fuction taught in the course?)
Can we distinguish between 2 functions that give the correct results to the same problem in diff ways, to figure which is better?(maybe something like time taken etc.?)
P.S: How does codecademy make those cool default display pictures that are different for every user?