【checkio】Roman Numerals(Electronic Station)

【他の人のコード】

def _make_roman_nums(i, v, x):
    return ['', i, i * 2, i * 3, i + v, v, v + i, v + i * 2, v + i * 3, i + x]
<200b>
roman_nums = [_make_roman_nums('I', 'V', 'X'),  # ones
              _make_roman_nums('X', 'L', 'C'),  # tens
              _make_roman_nums('C', 'D', 'M'),  # hundreds
              _make_roman_nums('M', '', '')[:4]]  # thousands
<200b>
def checkio(number):
    # 852 -> (3, 0), (2, 8), (1, 5), (0, 2)
    digits = [(place, number // (10 ** place) % 10) for place in range(3, -1, -1)]
    return ''.join(roman_nums[place][value] for place, value in digits)
<200b>||<

【自分のコード】
>|python|
def checkio(data):
    roman_list = []

    #1
    roman_list.append(create_roman_list("I", "V", "X"))
    #10
    roman_list.append(create_roman_list("X", "L", "C"))
    #100
    roman_list.append(create_roman_list("C", "D", "M"))
    #1000
    roman_list.append(create_roman_list("M", "", ""))

    str_data = str(data)
    
    #replace this for solution
    return_data = "".join([roman_list[len(str_data)-1-i][int(str_data[i])] for i in range(len(str_data))])
    
    return return_data
    
def create_roman_list(i, v, x):
    return ["", i, i+i, i+i+i, i+v, v, v+i, v+i+i, v+i+i+i, i+x]

if __name__ == '__main__':
    
    #These "asserts" using only for self-checking and not necessary for auto-testing
    assert checkio(6) == 'VI', '6'
    assert checkio(76) == 'LXXVI', '76'
    assert checkio(499) == 'CDXCIX', '499'
    assert checkio(3888) == 'MMMDCCCLXXXVIII', '3888'