str = "string" str = str[:-1] # Returns "strin"
your_string = "hello" your_string = your_string[:-1] # this removes the last character from your string
test = ["80010","80030","80050"] newtest = [x[:-1] for x in test] # newtest is now ["8001","8003","8005"]
str = "abc" str = str[:-1] print(str) >>> ab
st = "abcdefghij" st = st[:-1]