Question: Let me explain my problem with a real life code example:  

```
message = "hello"
for char in message:
    print(char)

```

This program output is: 

```
h
e
l
l
o

```

But i want to know character position. when i use `str.index()` it become:

```
message = "hello"
for char in message:
    print(char, message.index(char))

```

Output:

```
h 0
e 1
l 2
l 2
o 4

```

The `L` position is 2, and not 2 and 3!
How can i get character position while iterating over this message?

Answer: 
`.index()` finds the *first* index of an element in the given list. If it appears multiple times, only the first occurrence is returned.

If you want to get pairs of elements and their respective indexes, you can use the built-in function `enumerate()`:

```
for idx, char in enumerate(message):
    print(char, idx)

```
I adjusted your code with enumerate, this should work

```
    message = "hello"
    for index,char in enumerate(message):
        print(char,index)

```

You can find some documentation about it in the official python docs or [here](http://book.pythontips.com/en/latest/enumerate.html)