This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients chetanpalliwal13, rhettinger
Date 2020-10-13.10:00:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1602583222.05.0.121669022776.issue42026@roundup.psfhosted.org>
In-reply-to
Content
The index() method is working as expected.  This isn't a bug.

The easiest way to accomplish your goal is to use enumerate() with a list comprehension:

    >>> po = [11,22,33,44,11,55,66,11,88]
    >>> [i for i, value in enumerate(po) if value == 11]
    [0, 4, 7]
History
Date User Action Args
2020-10-13 10:00:22rhettingersetrecipients: + rhettinger, chetanpalliwal13
2020-10-13 10:00:22rhettingersetmessageid: <1602583222.05.0.121669022776.issue42026@roundup.psfhosted.org>
2020-10-13 10:00:22rhettingerlinkissue42026 messages
2020-10-13 10:00:22rhettingercreate