KnowledgeBoat Logo

Computer Science

What is the internal structure of python strings ?

Python String Manipulation

2 Likes

Answer

Strings in python are stored as individual characters in contiguous memory locations, with two-way index for each location. The index (also called subscript) is the numbered position of a letter in the string. Indices begin 0 onwards in the forward direction up to length-1 and -1,-2, …. up to -length in the backward direction. This is called two-way indexing.

Answered By

1 Like


Related Questions