Skip to content

Commit

Permalink
Create censor
Browse files Browse the repository at this point in the history
well.use replace is way too easy than use split and " ".join()
  • Loading branch information
zfk513 authored Aug 17, 2017
1 parent 378ed3d commit 1e6def8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions censor
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
def censor(text,word):
return text.replace(word,"*"*len(word))
print censor("this hack is wack hack", "hack")

0 comments on commit 1e6def8

Please sign in to comment.