From 132c71e855a2ba84207bed6ee1e531e6f66f9e6f Mon Sep 17 00:00:00 2001 From: Walt Mankowski Date: Sat, 10 Oct 2020 19:04:15 -0400 Subject: use split() instead of split('') --- challenge-081/walt-mankowski/python/ch-2.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/challenge-081/walt-mankowski/python/ch-2.py b/challenge-081/walt-mankowski/python/ch-2.py index 2b6c400b45..b348f03819 100644 --- a/challenge-081/walt-mankowski/python/ch-2.py +++ b/challenge-081/walt-mankowski/python/ch-2.py @@ -8,9 +8,7 @@ with open(fname) as f: for line in f: line = line.rstrip() line = re.sub('--', ' ', line) - if line == '': - continue - toks = line.split(' ') + toks = line.split() for tok in toks: tok = re.sub('[."(),]', '', tok); tok = re.sub("'s$", '', tok) -- cgit