Untested, but it should work. Let me know if something doesn't.
there is no increment operator in python, you have to use
x += 1 instead
also, for loops in python give you the item in the list, not the indices. so instead of
for z in name2 you'd have to use
for z in range(len(name2)), where range is a function that returns a generator that generates a "list" using integers with a length equal to the argument, which in this case is the length of name2
so range(10) generates "0, 1, 2, 3, 4, 5, 6, 7, 8, 9"
range() also has more functionality but that's irrelevant right now
one problem (??) with your code jairo is that the last for loop picks a random name from name2, which, as it turns out, can include a name that has already had one of the suffixes appended to it. which means you can get names like "Sultan Selim the Lawgiver the Great"
but idk, maybe that's intentional?
anyway here
http://pastebin.com/N5H6YbczI included a function somebody else made for the part that actually converts a number to a roman numeral
besides what you asked for, I also changed a few other things to make it better (sometimes subjectively):
more descriptive variable names
in the for loops, changed the letters to i, j, and k
shortened the contents of the first loop
speaking of for loops, instead of adding the roman numeral bit to the first one, it does that in a second loop. the loop goes backwards, because that was the easiest way I could think of for doing it
and fixed the problem with the last loop that I mentioned before, where you'd get repeats. my edits will not allow more than one suffix to be added to a single name, nor will it allow one suffix to be used more than once. if that
was intentional, it should be easy to switch either part back. if you want both to be the same I also left the original code at the top of the loop, but commented. the only changes I made to it were selecting a name considering the length of the list and splitting it into two lines to keep it under 80 characters long
I think that's all of it
here's some example output:
Sultan Suleiman
Sultan Selim
Sultan Orhan
Sultan Bayezid
Sultan Bayezid II the Silent
Sultan Bayezid III the Lawgiver
Sultan Orhan II
Sultan Bayezid IV the Great
Sultan Selim II
Sultan Bayezid Vclearly, the Bayezids were exceptional leaders
did we establish which of the following the blf prefers?
I prefer the first bracket to be on the same line that it starts on, like the first one
also spaces are better. I don't know of any reason to use tabs intentionally