What is indexing in context to Python strings ? J Why is it also called two-way indexing ?
What is indexing in context to Python strings ? J Why is it also called two-way indexing ?
4 views
1 Answers
In Python strings, each individual character is ! given a location number, called “index” and this process is called “indexing”. Python allocates indices in two directions :
1. in forward direction, the indexes are numbered as 0,1, 2, length-1.
2. in backward direction, the indexes are numbered as -1, -2, -3,…. length. This is known as “two-way indexing”.
4 views
Answered