Decimal to roman python
If you use a list of tuples instead of a dictionary and reverse the order, you can simply iterate over it. Your while loop also becomes a lot easier to understand and there is no longer any need to outsource it to another function that returns the literal and its count.

Instead of manually adding strings (something you should basically never do in in Python), use str.join.

ROMAN_LITERALS = [(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')]

def decimal_to_roman(x):
    out = []
    for value, literal in ROMAN_LITERALS:
        while x &gt;= value:
            x -= value
            out.append(literal)
    return "".join(out)


Instead of the while loop you can also use integer division like you did:

def decimal_to_roman(x):
    out = []
    for value, literal in ROMAN_LITERALS:
        n = x // value               # will be 0 if value is too large
        out.extend([literal] * n)    # will not do anything if n == 0
        x -= n * value               # will also not do anything if n == 0
    return "".join(out)