This question already has an answer here:
Python: Delete a character from a string
str objects don't support item deletion because they're immutable. The closest you can do is to make a new string w/out the last character by slicing the string:
In : 'puete'[:-1] Out: 'puet'
Strings are immutable, i.e. can't be changed in-place; you cannot delete a single character. Instead, create a new string and assign it back to the same name:
s = "puete" s = s[:-1]
[:-1] means "up to but not including the last character", and will create a new string object with fewer characters.