Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
give me points solution in Clear category for Roman Numerals by kamilinho20
def checkio(data):
a = str(data)
# like it and give me points
tab = [['', 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX'], ['', 'X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC'],
['', 'C', 'CC', 'CCC', 'CD', 'D', 'DC', 'DCC', 'DCCC', 'CM'], ['', 'M', 'MM', 'MMM']]
size = len(a) - 1
iter = size
result = ""
while iter >= 0:
val = int(a[iter])
result = tab[size - iter][val] + result
iter = iter - 1
#replace this for solution
return result
if __name__ == '__main__':
#These "asserts" using only for self-checking and not necessary for auto-testing
checkio(655)
Dec. 21, 2016