Joined
28 Jul 2022
# Project 1
def roman_to_int(roman):
conv = {
'M':1000,
'D':500,
'C':100,
'L':50,
'X':10,
'V':5,
'I':1
}
idx = 0
number = 0
while idx < len(roman) - 1:
if conv[roman[idx]] < conv[roman[idx]]:
number = number - conv[roman[idx]]
else:
number = number + conv[roman[idx]]
idx = idx + 1
return(number)
# giving value back to where it called