Let Python do the work for you and figure out the roman numerals for a given integer. I have to ask you to keep the integer values somewhat reasonably low (from 1 to 4999), since roman numerals from 5000 on use characters with an overline and most PCs don't have those in the character set.

```
# convert an integer to a roman numeral
# keep it reasonable since from 5000 on special characters are used
# see also: http://en.wikipedia.org/wiki/Roman_numerals
# tested with Python24 vegaseat 25jan2007
def int2roman(number):
numerals = { 1 : "I", 4 : "IV", 5 : "V", 9 : "IX", 10 : "X", 40 : "XL",
50 : "L", 90 : "XC", 100 : "C", 400 : "CD", 500 : "D", 900 : "CM", 1000 : "M" }
result = ""
for value, numeral in sorted(numerals.items(), reverse=True):
while number >= value:
result += numeral
number -= value
return result
print int2roman(input("Enter an integer (1 to 4999): "))
"""
Enter an integer (1 to 4999): 2007
MMVII
"""
```

pythonuser18
0
Newbie Poster

Gribouillis
1,391
Programming Explorer
Team Colleague

vegaseat
1,735
DaniWeb's Hypocrite
Team Colleague

pythonuser18
0
Newbie Poster

woooee
814
Nearly a Posting Maven

eljakim
0
Newbie Poster

TrustyTony
888
pyMod
Team Colleague
Featured Poster

TrustyTony
888
pyMod
Team Colleague
Featured Poster

eljakim
0
Newbie Poster

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.