What is indexing in context to Python strings ? J Why is it also called two-way indexing ?
Answers
Answered by
8
Indexing in context of python string and two way indexing:
• In Python strings, each separate character is assigned a location number, named “index” and this process is known as “indexing”.
• Python assigns indices in 2 directions: 1. in forward direction; here 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 recognized as “two-way indexing”.
Hope it helped..
Answered by
0
- In python strings , each individual characters is given a location number , called index and this process is called indexing.
- Python allocates indices in two directions:
- In forward direction, the indexes are numbered as 0,1,1. ...length -1.
- In backward direction, the indexes are numbered as -1. This is known as two way indexing.
Similar questions
Science,
5 months ago
English,
5 months ago
English,
5 months ago
Computer Science,
10 months ago
Computer Science,
10 months ago
Math,
1 year ago