Recursively Convert Roman Number to Integer
Writing down all your basecases takes a lot of space. I would instead use a dictionary, which could even be a global constant.
I find using n as an argument for something that is not an integer to be misleading. A generic x or s or roman_numeral would be clearer, IMO.
Python has an official style-guide, PEP8. It recommends using four spaces as indentation.
BASE_CASES = {&quot;&quot;: 0, &quot;M&quot;: 1000, &quot;D&quot;: 500, &quot;C&quot;: 100, &quot;L&quot;: 50, &quot;X&quot;: 10, &quot;V&quot;: 5, &quot;I&quot;: 1}

def roman(s):
    &quot;&quot;&quot;Takes a roman number x as an argument and returns an integer.
    Assumes that the string is correctly written, i.e. it provides no error-checking.
    &quot;&quot;&quot;
    if s in BASE_CASES:
         return BASE_CASES[s]

    # If a smaller number precedes a bigger number, 
    # then the smaller number is to be subtracted from 
    # the bigger number. Else, it has to be added:
    first, second = map(roman, s[:2])
    if first &lt; second:
        return second - first + roman(s[2:])
    else:
        return first + roman(s[1:])

Of course, using a recursive approach in Python is usually not the best idea, converting it to an iterative approach is much better (i.e. usually faster and not fraught with stack limit issues):
from itertools import tee

def pairwise(iterable):
    &quot;s -&gt; (s0,s1), (s1,s2), (s2, s3), ...&quot;
    a, b = tee(iterable)
    next(b, None)
    return zip(a, b)

def roman(s):
    if s in BASE_CASES:
        return BASE_CASES[s]
    return sum(first if first &gt;= second else second - first
               for first, second in pairwise(map(BASE_CASES.get, s)))