With string indices, is there a way to slice to end of string without using len()? Negative indices start from the end, but [-1] omits the final character.
w
I found myself needing to specify the end index as an input variable in a function. In that case, you can make end=None. For example:
end=None
def slice(val,start=1,stop=None) return val[start:stop] word = "Help" slice(word) # output: 'elp'