syntax

1
string[0:-1]

example: removing the last character from string

1
2
3
4
5
v = "hello world"
#remove the last character
rm_lst_c = v[0:-1]

print(rm_lst_c)

output

1
 hello worl 

example 2: remove the last 3 characters from string

1
2
v = "hello world"
print(v[0:-3])

output

1
hello wo

English today is not an art to be mastered it's just a tool to use to get a result