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:
1234567string = "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)
As you may have recognized, the index()
function has the following syntax:
string.index('word')
Swipe to start coding
Here's one more simple task to increase your knowledge base.
- Find the index of the word
burning
. - Find the index of the word
desire
. - Find the index of the word
studying
.
Рішення
Дякуємо за ваш відгук!
single
Запитати АІ
Запитати АІ
Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат
Awesome!
Completion rate improved to 3.03Awesome!
Completion rate improved to 3.03
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:
1234567string = "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)
As you may have recognized, the index()
function has the following syntax:
string.index('word')
Swipe to start coding
Here's one more simple task to increase your knowledge base.
- Find the index of the word
burning
. - Find the index of the word
desire
. - Find the index of the word
studying
.
Рішення
Дякуємо за ваш відгук!
single
Awesome!
Completion rate improved to 3.03
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:
1234567string = "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)
As you may have recognized, the index()
function has the following syntax:
string.index('word')
Swipe to start coding
Here's one more simple task to increase your knowledge base.
- Find the index of the word
burning
. - Find the index of the word
desire
. - Find the index of the word
studying
.
Рішення
Дякуємо за ваш відгук!