0
Always do your best.problem
#Given the quote: "Always do your best. Your best is going to change from moment to moment; it will be different when you are healthy as opposed to sick. Under any circumstance, simply do your best, and you will avoid self-judgment, self-abuse and regret." #Complete the program so that it will take a word as input and output the number of times that word appears in the quote.
7 Respostas
+ 1
import re
quote = "Always do your best. Your best is going to change from moment to moment; it will be different when you are healthy as opposed to sick. Under any circumstance, simply do your best, and you will avoid self-judgment, self-abuse and regret"
word = input()
#your code goes here
pattern=word
print(len(re.findall(pattern, quote)))
+ 4
Nadhiya Kandaswami
Show your attempts.
+ 2
Thank you so much Nasir Elmurtada
0
Only 1 case is solve and other errors are there
0
import re
quote=r"Always do your best.Your best is oing to change from moment to moment;it will be different when you are healthy as opposed to sick.Under any circumstance, simply do your best, and you will avoidself-judgment,self-abuse and regret."
word=input()
match=(re.findall(quote,word))
print(len(match))
What's wrong in this code
0
import re
quote = "Always do your best. Your best is going to change from moment to moment; it will be different when you are healthy as opposed to sick. Under any circumstance, simply do your best, and you will avoid self-judgment, self-abuse and regret"
word = input()
#your code goes here
count = re.findall(word, quote)
print(len(count))
0
Nadhiya Kandaswami
you are finding quote in word but you should find word in quote.
hope it will help you.