How come the count of letters is one extra


How come the count of letters is one extra(in len of string)?

FAQ: Learn Python – Strings & Console Output – String Methods

The count is natural, and starts with 1. The index is an offset from the left edge, the first element being zero distance from that, hence zero-indexing.

Indices are sequential, but their role is not so much to count, as to point.


One more than what?
You use the word “letters”, perhaps you have an expectation of letters being treated differently from other characters?


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.