Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Find the Word Index | Section
Working with Numbers in Python: Integers, Floats, and Type Conversion - 1769704232138
Section 1. Chapitre 22
single

single

Find the Word Index

Glissez pour afficher le menu

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)

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

string.index('word')
Tâche

Glissez pour commencer à coder

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.

Solution

Switch to desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 1. Chapitre 22
single

single

Demandez à l'IA

expand

Demandez à l'IA

ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

some-alt