Python entfernen Sie das erste und letzte Zeichen aus String
string = string[1:-1]
Annoyed Antelope
string = string[1:-1]
greeting = "HHello world!"
new_greeting = greeting[1:]
# In here we select greeting string from character 1 to end (except character 0)
print(new_greeting)
#output: Hello world!
s = ":dfa:sif:e"
print(s[1:])
prints:
dfa:sif:e
r = "hello"
r = r[1:]
print(r) # ello