diff options
| author | Abigail <abigail@abigail.be> | 2021-06-13 21:14:34 +0200 |
|---|---|---|
| committer | Abigail <abigail@abigail.be> | 2021-06-13 21:14:34 +0200 |
| commit | 7e7b2cab61dcef029b71bd066bf6b5e3a71011af (patch) | |
| tree | c59db29ec40c06bef679a896618fc3dbbbe4b977 /challenge-116/abigail/python/ch-1.py | |
| parent | 3fe9fba9c9d2ec298020988b59ddf16dade7285f (diff) | |
| download | perlweeklychallenge-club-7e7b2cab61dcef029b71bd066bf6b5e3a71011af.tar.gz perlweeklychallenge-club-7e7b2cab61dcef029b71bd066bf6b5e3a71011af.tar.bz2 perlweeklychallenge-club-7e7b2cab61dcef029b71bd066bf6b5e3a71011af.zip | |
Rename make_chain to make_sequence
Diffstat (limited to 'challenge-116/abigail/python/ch-1.py')
| -rw-r--r-- | challenge-116/abigail/python/ch-1.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/challenge-116/abigail/python/ch-1.py b/challenge-116/abigail/python/ch-1.py index 795d4ecabd..b988189564 100644 --- a/challenge-116/abigail/python/ch-1.py +++ b/challenge-116/abigail/python/ch-1.py @@ -10,14 +10,14 @@ import fileinput -def make_chain (string, start): +def make_sequence (string, start): if string == start: return [start] if 0 == string . find (start): tail = string [len (start) :] - result = make_chain (tail, str (int (start) + 1)) or \ - make_chain (tail, str (int (start) - 1)) + result = make_sequence (tail, str (int (start) + 1)) or \ + make_sequence (tail, str (int (start) - 1)) if result: return [start] + result @@ -27,7 +27,7 @@ def make_chain (string, start): for line in fileinput . input (): line = line . strip () for i in range (0, len (line)): - result = make_chain (line, line [0 : i + 1]) + result = make_sequence (line, line [0 : i + 1]) if result: print ("," . join (result)) break |
