Python Forum
[Help] Convert integer to Roman numerals? {Screenshot attached}
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Help] Convert integer to Roman numerals? {Screenshot attached}
#6
@volcano63
Walking through a list of tuples seem pretty elegant.
Since it not jumping around the list.

Saying something is un-Pythonic. Doesn't make it so.

Changing list to a tuple probably be better. Just because it keeps it all immutable.
roman_map = ((1000, "M"), (900, "CM"), (500, "D"), (400, "CD"), (100, "C"),
    (90, "XC"), (50, "L"), (40, "XL"), (10, "X"), (9, "IX"), (5, "V"),
    (4, "IV"), (1, "I"))
But not a must.
99 percent of computer problems exists between chair and keyboard.
Reply


Messages In This Thread
RE: [Help] Convert integer to Roman numerals? {Screenshot attached} - by Windspar - Aug-06-2018, 02:51 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to convert 4 bytes to an integer ? GiggsB 11 7,151 Jan-20-2022, 03:37 AM
Last Post: GiggsB
  Help with implementation of the logic to convert roman numeral to integer jagasrik 2 2,356 Aug-14-2020, 07:31 PM
Last Post: deanhystad
  Converting number to roman numerals jagasrik 6 3,725 Aug-11-2020, 03:47 AM
Last Post: voidptr
  IEDriverServer screenshot ABVSVL 0 1,778 Jul-12-2020, 09:31 AM
Last Post: ABVSVL
  pyautogui.screenshot region is not working alexlu 6 6,627 Jun-04-2020, 10:46 AM
Last Post: alexlu
  What is the best way to search for a pixel in a screenshot? TheZadok42 1 2,691 May-15-2020, 12:37 PM
Last Post: scidam
  Spawning a new process that is not attached to python cman234 3 1,971 Apr-25-2020, 05:24 PM
Last Post: cman234
  Roman Numeral Ordered List? (first post) CopperyMarrow15 1 1,771 Nov-06-2019, 11:06 PM
Last Post: Larz60+
  My objective is to get the shape parameters of the particles in attached image chad221 0 1,812 Oct-26-2019, 10:27 AM
Last Post: chad221
  Want to take a Screenshot from a File in Linux dhiliptcs 2 2,609 Oct-21-2019, 01:22 PM
Last Post: dhiliptcs

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020