python
Dashboard
My Repos
Compilers
Python Online
Node JS Online
Golang Online
codepy
Login
My Repos
Sign Out
Online Python Interpreter
Stop
Run
stepwords = list() stepwords.append("asshole") stepwords.append("bitch") stepwords.append("fuck") text = "fuck my asshole you bitch" querywords = text.split() resultWords = list() for word in querywords: if word.lower() in stepwords: word = word[:1] + (len(word)-1) * "*" resultWords.append(word) correctedText = " ".join(resultWords) print(correctedText) offsetDict = { "0": "4", "8": "7", "20": "5" } correctedText = text for startIndex in offsetDict.keys(): textList = list(correctedText) x = range(int(startIndex)+1, int(startIndex) + int(offsetDict[startIndex])) for n in x: textList[n] = "*" correctedText = ''.join(textList) print(correctedText)
Share this code with others
Public
Clear
My Repos
Repo
Lang
Login
Register
Login
Create a free account. No Credit card info required.
I agree with the Codepy
Term of Service
Sign Up