[Solved] How to display position of an element in an array? [closed]

[ad_1]

I think you have a simple, one-line change.
You get the name instead of the index, because that’s exactly what you told it to print. Instead, use this:

    print('The index of this name is ', index)

Your original went to the extra trouble to look up the name in that location.

1

[ad_2]

solved How to display position of an element in an array? [closed]