Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Roman Numerals by Surovykh
def checkio(data):
coding = 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"])
result = []
for l, p in coding:
while data >= l:
result.append(p)
data -= l
return ''.join(result)
Dec. 6, 2016