Set the right two characters (if there are any) to capitals?

Posted by Hyflex on Stack Overflow See other posts from Stack Overflow or by Hyflex
Published on 2013-10-29T03:46:03Z Indexed on 2013/10/29 3:53 UTC
Read the original article Hit count: 125

Filed under:
|

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

© Stack Overflow or respective owner

Related posts about python

Related posts about python-2.7