[Dave] Question 7, test if you understand how to use the find method.
Assume that the variable text holds a string.
Your goal is to write some Python code that prints out the position
of the first occurrence of hoo, H-O-O,
in the value of text or -1 if the string hoo
does not occur at all in text.
Pregunta No. 7, comprueba si entienden como usar el método find.
Asumamos que la variable "text" contiene una cadena.
Su meta es escribir un código en Python que muestre la posición
de la primera ocurrencia de "hoo", H-O-O,
en el valor de text o un -1 si la cadena "hoo"
no está presente en ninguna parte de text,
Domanda n. 7, verifichiamo se avete capito come usare il metodo find
Assumiamo che la variabile text si riferisca ad una stringa
Il vostro scopo è scrivere codice Python che stampi la posizione
della prima occorrenza di hoo, H-O-O,
nel contenuto di text oppure -1 se la stringa hoo
non è presente in alcun modo in text
問題7ではFindメソッドの使い方を
理解しているかテストします
変数textは文字列を保持していると仮定します
テキストの値もしくはテキスト内で文字列hooが
まったく出現しない場合はー1で
hooの初めに出現する位置を出力する
Pythonコードを書いてください
Pergunta 7, testa se você entendeu
como usar o método find.
Suponha que a variável "text" contém uma string.
Seu objetivo é escrever um
código Python que imprima a posição
da primeira ocorrência de hoo, h-o-o,
no valor de texto ou
-1 se a string hoo
não ocorre em "text".
[Дэйв] Задание 7 проверит ваше умение пользоваться методом find().
Положим, что в переменной text содержится строка.
Ваша цель – написать на Python код, который выводит позицию
первого вхождения строки 'hoo', H-O-O
в строку text или -1, если строка 'hoo'
не содержится в переменной text.
[Дейв] Завдання 7 перевірить ваше вміння користуватися методом find ().
Припустимо, що у змінній text міститься рядок.
Ваша мета - написати на Python код, який виводить позицію
першого входження рядка 'hoo', H-O-O
в рядок text або -1, якщо рядок 'hoo'
не міститься в змінній text.
問題 7,測試你是否了解如何使用 find 方法
假設變數 text 包含一個字串
你的目標是寫一些 Pythont 程式碼
印出 'hoo' 在 text 第一次出現的位置
或是印出 -1
如果字串 'hoo' 從未出現於 text 中