Doing a python problem and trying to create a new string that omits a single char at index n. This works:
newstr = str[:n] + str[n+1:]
but wondering why this didn't work:
newstr = str[:n] + str[-1:-(n+1)]
Thanks in advance^
Doing a python problem and trying to create a new string that omits a single char at index n. This works:
newstr = str[:n] + str[n+1:]
but wondering why this didn't work:
newstr = str[:n] + str[-1:-(n+1)]
Thanks in advance^