python string slice last code example
Example 1: python remove last part of string
#Removing last three characters
foo = foo[:-3]
Example 2: remove last character from string python
st = "abcdefghij"
st = st[:-1]
#Removing last three characters
foo = foo[:-3]
st = "abcdefghij"
st = st[:-1]