Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
replacing solution in Creative category for Roman Numerals by David_Jones
def checkio(data):
result = ''
for numeral, value in zip('MDCLXVI', (1000, 500, 100, 50, 10, 5, 1)):
i, data = divmod(data, value)
result += numeral * i
return (result.replace('DCCCC', 'CM').replace('CCCC', 'CD')
.replace('LXXXX', 'XC').replace('XXXX', 'XL')
.replace('VIIII', 'IX').replace('IIII', 'IV'))
May 12, 2019
Comments: