Single character Roman numeral [FINALIZED]
Now posted: Single digit Roman numeral
Given a single character, which is a valid Roman numeral, output its value.
There are 7 valid single character Roman numerals, with the following values:
- A single character, which will always be one of
- The corresponding value.
As there are only 7 valid inputs, the list of test cases is exhaustive.
Test cases are in the format
"input" : output.
"I" : 1 "V" : 5 "X" : 10 "L" : 50 "C" : 100 "D" : 500 "M" : 1000
This is a code golf challenge. Your score is the number of bytes in your code.
Explanations are optional, but I'm more likely to upvote answers that have one.