0
r"(inputted word)"______in re.findall
How can I add inputted word to r? 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() #Š¼ŠµŃŃŠ¾ Š“Š»Ń Š²Š°ŃŠµŠ³Š¾ ŠŗŠ¾Š“Š° pattern = r"word" <---------------- print(len(re.findall(pattern, quote)))
1 Answer
0
ŠŠ»ŠµŠŗŃŠ°Š½Š“Ń ŠŃŠ°Š¼Š¾Š²ŠøŃ, use the format function to form the pattern. Look at the code.
https://code.sololearn.com/cjFS32rW9WEZ/?ref=app