Findall Method
findall()
is a method that returns a list containing all matches of the pattern in the given string.
Tarefa
Swipe to start coding
- Define a text variable with
"The cat is cute. The dog is also cute."
. - Use the
findall()
method and print the results.
Solução
9
1
2
3
4
5
6
import re
text = "The cat is cute. The dog is also cute."
x = re.findall("cute", text)
print(x) # Output: ['cute', 'cute']
Mark tasks as Completed
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 1. Capítulo 8
Pergunte à IA
Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo