I need to extract the last two characters of a phrase, but I don't know how as there isn't a minus 0.
Asked
Active
Viewed 833 times
-2
-
`s[-2:]` works. Note that `s[-1]` *is* the last character in the string, so there is no need for "minus 0" to extract it. – John Coleman May 07 '20 at 11:06
-
already answered [here](https://stackoverflow.com/questions/663171/how-do-i-get-a-substring-of-a-string-in-python) – Achuth Varghese May 07 '20 at 11:07