Skip to content

Improve language of list.index in tutorial #107194

@pulsar17

Description

@pulsar17

Documentation

The first sentence of list.index (https://docs.python.org/3/tutorial/datastructures.html) reads:

Return zero-based index in the list of the first item whose value is equal to x.

A similar desription of the index method but in the context of Common Sequence Operations (https://docs.python.org/3/library/stdtypes.html#common-sequence-operations):

s.index(x[, i[, j]]) index of the first occurrence of x in s (at or after index i and before index j) (8)

As a non-native English speaker, the latter description reads more clearly.

Suggestion

Return zero-based index of the first item whose value is equal to x in the list.

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dir

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions