Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for Roman Numerals by TovarischZhukov
data = {1:lambda a,b,c :a,
2:lambda a,b,c :a*2,
3:lambda a,b,c :a*3,
4:lambda a,b,c :a+b,
5:lambda a,b,c :b,
6:lambda a,b,c :b+a,
7:lambda a,b,c :b+a*2,
8:lambda a,b,c :b+a*3,
9:lambda a,b,c :a+c,
0:lambda a,b,c :""}
def checkio(number):
return data[number/1000]("M","","")+\
data[number%1000/100]("C","D","M")+\
data[number%1000%100/10]("X","L","C")+\
data[number%1000%100%10]("I","V","X")
Dec. 5, 2015
Comments: