Python Forum
Roman Numeral Ordered List? (first post)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Roman Numeral Ordered List? (first post)
#1
Hello...
I'm trying to make a program that creates an ordered list marked by several different pieces of text (like in html if anyone here uses that); one of those making are roman numerals. It would have the capability of listing provided items line by line with each line having a roman numeral before it...
Here is a brief version of what I have so far:
def ordlist(arrangement,targets): #arrangement is intended to be how the ordered list is ordered...and targets is intended to be a list of the sting that will be ordered
    if type(arrangement)==str and type(targets)==list:
        if arrangement=='i': #lowercase roman numerals (just like in html)
            #Here...
        if arrangement=='I': #uppercase roman numerals
            #...and here are where I dont know what to put...
What I need is some sort of program that can get a roman numeral from a int and get all the other roman numerals before it...then append them all to a list, make everything in the list a sting, and return it...along with everything in targets being after it.
Please, if you can, let me know how I could accomplish this in non-extravagant manner.
If you don't understand anything or I'm breaking some rule, let me know. I should be quick to respond...
Reply
#2
see: ttps://www.oreilly.com/library/view/python-cookbook/0596001673/ch03s24.html
you can modify logic to get days before and after
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Help with implementation of the logic to convert roman numeral to integer jagasrik 2 2,297 Aug-14-2020, 07:31 PM
Last Post: deanhystad
  Converting number to roman numerals jagasrik 6 3,585 Aug-11-2020, 03:47 AM
Last Post: voidptr
Question [Help] Convert integer to Roman numerals? {Screenshot attached} vanicci 10 9,130 Aug-06-2018, 05:19 PM
Last Post: vanicci
  List of pathlib.Paths Not Ordered As Same List of Same String Filenames QbLearningPython 20 15,316 Nov-16-2017, 04:47 PM
Last Post: QbLearningPython

Forum Jump:

User Panel Messages

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