Anonymous user
SEDOLs: Difference between revisions
→{{header|Python}}: Original version was not improved.
(→{{header|Python}}: Original version was not improved.) |
|||
Line 287:
=={{header|Python}}==
<python>import string
# constants
tmp = sum(checksum.sedol2value[ch] * checksum.sedolweight[n]▼
sedol2value = dict((ch,
return checksum.sedolchars[ (10 - (tmp % 10)) % 10]▼
▲checksum.sedolchars = string.digits + string.ascii_uppercase
)
▲for ch in "AEIOU":
▲ del checksum.sedol2value[ch]
▲checksum.sedolchars = sorted(checksum.sedol2value)
▲checksum.sedolweight = [1, 3, 1, 7, 3, 9, 1]
for sedol in
710889
B0YBKJ
406566
B0YBLH
228276
B0YBKL
557910
B0YBKR
585284
B0YBKT
'''.split():
print sedol + checksum(sedol)
</python>
|