def roman_to_arabic(number):
    index_by_letter = {}
for index in range(len(numerals)):
    index_by_letter[numerals[index]['letter']] = index
result = 0
previous_value = None
for letter in reversed(number):
    index = index_by_letter[letter]
value = numerals[index]['value']
if previous_value is None or previous_value <= value:
    result += value
else:
    result -= value
previous_value = value
return result
Converting Roman Numerals to integers in python