How To Change The Case Of The Last Letter In A String In Python?
So I want to change the last character in a string to lower case. The code below is the method I am using to print a string backwards, but list leaves the last character as a capit
Solution 1:
Use str.title
:
>>> "Inbox"[::-1].title()
'Xobni'
Post a Comment for "How To Change The Case Of The Last Letter In A String In Python?"