How do I remove the last character of a string if its a letter.
e.g if I had the following strings.
my_string = 'ABC 1.1 A'
my_string2 = 'ABC 1.1 B'
my_string3 = 'DEF 1'
I would want my_string = 'ABC 1.1', my_string2 = 'ABC 1.1', and my_strin3 = 'DEF 1'
These strings are generated from DB so it would not be a manual process.
You can use
str.rstrip():This will remove all letters and whitespace characters from the end of the string.