Integer to roman numeral - Solutions

Exercise

Solution

A function that converts an integer to a roman numeral

Shorter but less explicit solution

The code above can be shortened by using less variables but, since only the variable repetitions can be removed and it’s important to use round brackets (integer // value) to maintain the order of precedence of the operators, the overall benefit is small.

A function that converts an integer to a roman numeral - shorter but less explicit solution