Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- numerals = [
- ("Y", 10000000),
- ("QY", 9000000),
- ("Z", 5000000),
- ("QZ", 4000000),
- ("Q", 1000000),
- ("UQ", 900000),
- ("E", 500000),
- ("UE", 400000),
- ("U", 100000),
- ("PU", 90000),
- ("K", 50000),
- ("PK", 40000),
- ("P", 10000),
- ("MP", 9000),
- ("A", 5000),
- ("MA", 4000),
- ("M", 1000),
- ("CM", 900),
- ("D", 500),
- ("CD", 400),
- ("C", 100),
- ("XC", 90),
- ("L", 50),
- ("XL", 40),
- ("X", 10),
- ("IX", 9),
- ("V", 5),
- ("IV", 4),
- ("I", 1)
- ]
- int_value = int(raw_input("Enter an integer value: "))
- output = ""
- for letter, value in numerals:
- output += (int_value / value) * letter
- int_value -= (int_value / value) * value
- print output
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement