Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Exercise: Roman numbers

  • Write a function that will convert Roman numbers to Arabic numbers (integers).
    1. Enough to handle between 1-3999.
    2. Try to handle more numbers.
    3. Write tests.
    4. Raise an exception if an invalid string is encountered.