my_string = “This is MY string!”
print(my_string[8:len(my_string)])
given output: MY string!
It is mentioned that The character at the end
index in the string, will not be included in the substring obtained through this method.
Since the end of the substring is len(my_string) the last character of the string is ! and thus that should not be included. Instead shouldn’t the output be just
MY string