Indexes

We talked earlier about how strings can be made up of characters, like letters or numbers, or even punctuation marks.

Each of those characters has a position in the string, and that position is called an index.

Let's look at the example we have here. This concatenated string is the word "Hello", and it's made up of five characters - five letters.

>>> "H" + "e" + "l" + "l" + "o"

'Hello'

>>> "Hello"

'Hello'

We could start counting to identify the position of each letter. But here's something interesting to know about Python - instead of counting from one, we're going to start counting from zero.

H e l l o

0 1 2 3 4

So in our example, the letter 'H' has an index of zero, the letter 'e' has an index of one, and so on.