Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprenda Find the Word Index | Strings
Tipos de Dados em Python

Deslize para mostrar o menu

book
Find the Word Index

Hi there, it should be mentioned that there is another function that does the same action as find(), which is called index().

Like the very similar function find(), it finds the first appearance of the word. Look at the example to clarify its usage:

1234567
string = "I can manage everything" manage = string.index('manage') everything = string.index('everything') print("The index of the word manage is", manage) print("The index of the word everything is", everything)
copy

As you may have recognized, the index() function has the following syntax:

python
Tarefa

Swipe to start coding

Here's one more simple task to increase your knowledge base.

  1. Find the index of the word burning.
  2. Find the index of the word desire.
  3. Find the index of the word studying.

Solução

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 3. Capítulo 10
single

single

Pergunte à IA

expand

Pergunte à IA

ChatGPT

Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo

close

Awesome!

Completion rate improved to 3.03

book
Find the Word Index

Hi there, it should be mentioned that there is another function that does the same action as find(), which is called index().

Like the very similar function find(), it finds the first appearance of the word. Look at the example to clarify its usage:

1234567
string = "I can manage everything" manage = string.index('manage') everything = string.index('everything') print("The index of the word manage is", manage) print("The index of the word everything is", everything)
copy

As you may have recognized, the index() function has the following syntax:

python
Tarefa

Swipe to start coding

Here's one more simple task to increase your knowledge base.

  1. Find the index of the word burning.
  2. Find the index of the word desire.
  3. Find the index of the word studying.

Solução

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

close

Awesome!

Completion rate improved to 3.03

Deslize para mostrar o menu

some-alt