From 1e6def8d8a01daef07a75d50a370fd511b315e06 Mon Sep 17 00:00:00 2001 From: zfk513 Date: Thu, 17 Aug 2017 08:33:05 +0800 Subject: [PATCH] Create censor well.use replace is way too easy than use split and " ".join() --- censor | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 censor diff --git a/censor b/censor new file mode 100644 index 0000000..7fd0c11 --- /dev/null +++ b/censor @@ -0,0 +1,4 @@ +def censor(text,word): + return text.replace(word,"*"*len(word)) +print censor("this hack is wack hack", "hack") +