Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Simple solution solution in Clear category for Roman Numerals by u8m_
# migrated from python 2.7
def checkio(data):
nums = list(map(int, str(data).rjust(4,'0')))
symbol = "IVXLCDM "
roma = lambda n,c1,c2,c3: c1*n if n<4 else c1*(5-n)+c2+c1*(n-5) if n<9 else c1+c3
roman_num = ""
for i in range(4):
roman_num += roma(nums[i],*symbol[6-2*i:9-2*i])
return roman_num
Nov. 14, 2015