Question: Write a function called convert_to_roman(value) that converts an integer value into Roman numerals and returns a string. Roman numerals are a text representation of numbers.

 Write a function called convert_to_roman(value) that converts an integer value into

Write a function called convert_to_roman(value) that converts an integer value into Roman numerals and returns a string. Roman numerals are a text representation of numbers. The Roman numerals are as follows: Decimal Roman 5 10 X 50 L 100 500 D 1000 M The rules for Roman numerals are as follows: When a sequence of Roman numerals is encountered, the value they represent is the sum of the digits (e.g. XVI 10 Only the numerals 'IX','C' and ,M' may appear consecutively, and a maximum of 3 numerals the same may appear next to one another (eg, XXX) If a numeral appears before a larger numeral, then it is subtracted from that number. For example, ,IV, represents 4, and "XC, represents 90, Note that you can only do this with IV, IX, XL, XC, CD and CM. The largest value to be expressed in this way is MMMCMXCIX, which is 3999. For example, the year 2015 is represented as MMXV. The year 1997 would be MCMXCVII 51 16) . See https://en.wikipedia.org/wiki/Roman_numerals for more information. Your function should convert numbers between 1 and 3,999 inclusive. For example: Test Result print(convert_to_roman(7) VII

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!