Python Forum

Full Version: Roman Numeral Ordered List? (first post)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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...
see: ttps://www.oreilly.com/library/view/python-cookbook/0596001673/ch03s24.html
you can modify logic to get days before and after