[Python] Difference between find and index

Discussão em 'Python' iniciado por Stack, Novembro 26, 2024.

  1. Stack

    Stack Membro Participativo

    I cannot understand the difference between find and index.

    >>> line
    'hi, this is ABC oh my god!!'
    >>> line.find("o")
    16
    >>> line.index("o")
    16


    They always return the same result.

    Continue reading...

Compartilhe esta Página