Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,3 +1,4 @@
|
|||
from functools import reduce
|
||||
numerals = { 'M' : 1000, 'D' : 500, 'C' : 100, 'L' : 50, 'X' : 10, 'V' : 5, 'I' : 1 }
|
||||
def romannumeral2number(s):
|
||||
return reduce(lambda x, y: -x + y if x < y else x + y, map(lambda x: numerals.get(x, 0), s.upper()))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue