The Roman Converter
A easy Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- easy
- Seniority
- L3
Problem
Given a Roman numeral string using symbols I=1, V=5, X=10, L=50, C=100, D=500, M=1000, return its integer value. When a smaller symbol precedes a larger one (IV, IX, XL, XC, CD, CM), subtract it from the larger one.
Summary
Roman numerals decoded.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.