diff options
| author | Walt Mankowski <waltman@pobox.com> | 2020-10-10 19:04:15 -0400 |
|---|---|---|
| committer | Walt Mankowski <waltman@pobox.com> | 2020-10-10 19:04:15 -0400 |
| commit | 132c71e855a2ba84207bed6ee1e531e6f66f9e6f (patch) | |
| tree | e25c59cc4d088b1287308da9b0a59e05e0767a7c | |
| parent | 293c72bd0be6f09dba088d564d92d6820357bb3e (diff) | |
| download | perlweeklychallenge-club-132c71e855a2ba84207bed6ee1e531e6f66f9e6f.tar.gz perlweeklychallenge-club-132c71e855a2ba84207bed6ee1e531e6f66f9e6f.tar.bz2 perlweeklychallenge-club-132c71e855a2ba84207bed6ee1e531e6f66f9e6f.zip | |
use split() instead of split('')
| -rw-r--r-- | challenge-081/walt-mankowski/python/ch-2.py | 4 |
1 files changed, 1 insertions, 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) |
