Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created April 17, 2017 22:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codecademydev/e575de572a0f368b0cd2e85fbcaaa923 to your computer and use it in GitHub Desktop.
Save codecademydev/e575de572a0f368b0cd2e85fbcaaa923 to your computer and use it in GitHub Desktop.
Codecademy export
def censor(text, word):
text = text.split()
phrase = []
phrase.append(text)
for each in phrase:
if each == word:
return "*" * len(word)
else:
return each
return " ".join(phrase)
print censor("Hey there friend", "friend")
"""phrase = []
words = "This is a string of words"
words = words.split()
phrase.append(words)
print phrase"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment