Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Roman Numerals by aiwayfr89
symboles = ['M','CM','D','CD','C','XC','L','XL','X','IX','V','IV','I']
poids =[1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1]
def checkio(nb):
result = ''
for j,k in enumerate(poids):
if nb>=k:
multiple = ( nb // k)
nb = nb % k
for i in range(multiple):
result += symboles[j]
return result
Feb. 11, 2018