aboutsummaryrefslogtreecommitdiff
path: root/challenge-135/abigail/python
diff options
context:
space:
mode:
authorAbigail <abigail@abigail.be>2021-10-19 20:13:33 +0200
committerAbigail <abigail@abigail.be>2021-10-19 20:25:58 +0200
commit210e271ec3014cf6f08e9ce5d3e2ffbd92a61619 (patch)
treec1cc76b4f9b6e317f74e96487de3cb9054e86acd /challenge-135/abigail/python
parentec0548d9d1f8f277a0cd78d5a626c4efdd42f3ef (diff)
downloadperlweeklychallenge-club-210e271ec3014cf6f08e9ce5d3e2ffbd92a61619.tar.gz
perlweeklychallenge-club-210e271ec3014cf6f08e9ce5d3e2ffbd92a61619.tar.bz2
perlweeklychallenge-club-210e271ec3014cf6f08e9ce5d3e2ffbd92a61619.zip
Last character of a SEDOL must be a number.
Without this check, it could validate the SEDOL which uses a letter as a check digit. For instance, if the check digit is a '1', using 'B' would validate as well.
Diffstat (limited to 'challenge-135/abigail/python')
-rw-r--r--challenge-135/abigail/python/ch-2.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/challenge-135/abigail/python/ch-2.py b/challenge-135/abigail/python/ch-2.py
index 93ba2921e2..13ab812ae0 100644
--- a/challenge-135/abigail/python/ch-2.py
+++ b/challenge-135/abigail/python/ch-2.py
@@ -15,7 +15,7 @@ w = [1, 3, 1, 7, 3, 9, 1]
for line in fileinput . input ():
line = line . strip ()
- if re . search (r'^[0-9BCDFGHJKLMNPQRSTVWXYZ]{7}$', line):
+ if re . search (r'^[0-9BCDFGHJKLMNPQRSTVWXYZ]{6}[0-9]$', line):
check = 0
for i in range (len (line)):
val = ord (line [i : i + 1])