Python’s slice is a powerful way to refer to sub-parts in a string. … Negative Index Python also supports indexing into strings using negative numbers. -1 is the last character, -2 the next, and so forth. Also, -1 is the same index as len(s),-1, and -2 the same index as len(s),-2.
All the information on this website is published in good faith and for general information purpose only. Watson Media does not make any warranties about the completeness, reliability, and accuracy of this information.