find method in python | String methods in python | Python Tutorials 2023

Publicado em: 19 Janeiro 2024
no canal de: ThingsYouMustKnow
63
1

find method in python

In Python, the find() method is a string method that is
used to find the index of the first occurrence of a substring
within a string. If the substring is not found, it returns -1.

Here's an example:

my_string="Hello World"
index=my_string.find("World")

In this example, the find("World") method will search
for the substring "World" in the my_string variable.
If it finds the substring, it will return the index at
which it starts. If the substring is not found, it will return -1.

Please watch Video...!!!


Nesta página do site você pode assistir ao vídeo on-line find method in python | String methods in python | Python Tutorials 2023 duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário ThingsYouMustKnow 19 Janeiro 2024, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 63 vezes e gostou 1 espectadores. Boa visualização!