Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
MAPING numerals solution in Clear category for Roman Numerals by spoty
MAP = tuple(zip(
(1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1),
('M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I')))
def checkio(n):
r =[]
for integer, numeral in MAP:
count = n // integer
r.append(numeral * count)
n -= integer * count
return ''.join(r)
Feb. 1, 2015
Comments: