Validate International Securities Identification Number: Difference between revisions

m
No edit summary
m (→‎{{header|Python}}: not needed)
Line 377:
<lang python>def check_isin(a):
s = "".join(str(int(c, 36)) for c in a[:-1])
return ord(a[-1]) - 48 == (10 - sum(sum(divmod(2 * (ord(c) - 48), 10)) for c in s[-1::-2])
- sum(ord(c) - 48 for c in s[-2::-2])) % 10
 
list(map(check_isin, ["US0378331005", "US0373831009", "D56000543287", "AU0000XVGZA3",
Anonymous user