Integer to roman numeral
Converts an integer to its roman numeral representation.
Accepts value between 1
and 3999
(both inclusive).
- Create a lookup list containing tuples in the form of (roman value, integer).
- Use a
for
loop to iterate over the values inlookup
. - Use
divmod()
to updatenum
with the remainder, adding the roman numeral representation to the result.