Set the right two characters (if there are any) to capitals?
- by Hyflex
Below is my data:
Data Here 94/452O
Data more 94/4522i
Data bla 94/111
Data bla 94/459es
Data bla 94/444
items is automatically generated by some previous code but it could come out like:
items = ["Data Here 94/452O", "Data more 94/4522i", "Data bla 94/111", "Data bla 94/459es", "Data bla 94/444"]
Now currently I'm appending the following:
"\n".join(items).replace("4ke", "9") with a few other .replaces however I want it to replace/change the characters on the end of the numbers with a capital letter instead of lowercase...
Output:
Data Here 94/452O
Data more 94/4522I
Data bla 94/111
Data bla 94/459ES
Data bla 94/444