human
Write me a the Python code you requested given the following:
I found an interesting problem on https://www.codewars.com/kata/51b66044bce5799a7f000003:
## Task

Create a RomanNumerals class that can convert a roman numeral to and from an integer value.  It should follow the API demonstrated in the examples below. Multiple roman numeral values will be tested for each helper method. 

Modern Roman numerals are written by expressing each digit separately starting with the left most digit and skipping any digit with a value of zero. In Roman numerals 1990 is rendered: 1000=M, 900=CM, 90=XC.
resulting in MCMXC. 2008 is written as 2000=MM, 8=VIII.
or MMVIII. 1666 uses each Roman symbol in descending order: MDCLXVI.

## Examples

```python
RomanNumerals.to_roman(1000) # should return 'M'
RomanNumerals.from_roman('M') # should return 1000
```

## Help

| Symbol | Value |
|----------------|
| I          | 1     |
| V          | 5     |
| X          | 10    |
| L          | 50    |
| C          | 100   |
| D          | 500   |
| M          | 1000  |

I tried it in Python, but could not do it. Can you solve it?
assistant
#Here is the Python code you requested.

class RomanNumerals(object):
    
    @classmethod
    def to_roman(self, n, result='', i=0):
        SPQR = ((1000, 'M'), (900, 'CM'), (500, 'D'), (400, 'CD'), (100, 'C'), (90, 'XC'), (50, 'L'),
        (40, 'XL'), (10, 'X'), (9, 'IX'), (5, 'V'), (4, 'IV'), (1, 'I'))
        
        if i == len(SPQR):
            return result
        while n - SPQR[i][0] >= 0:
            result += SPQR[i][1]
            n -= SPQR[i][0]
        i += 1
        return self.to_roman(n, result, i)
        
        
    @classmethod
    def from_roman(self, roman, result=0, i=0):
        SPQR = ((900, 'CM'), (1000, 'M'), (400, 'CD'), (500, 'D'), (90, 'XC'), (100, 'C'), (50, 'L'),
        (40, 'XL'), (9, 'IX'), (10, 'X'), (4, 'IV'), (5, 'V'), (1, 'I'))
        
        if roman == '':
            return result
        while SPQR[i][1] in roman:
            result += SPQR[i][0]
            roman = roman[len(SPQR[i][1]):]
        i += 1
        return self.from_roman(roman, result, i)