0

Some problems with a code in the practice 6

There was nothing about the search function in the lessons. And I don’t know how to send a message: with “return” or “print”. https://code.sololearn.com/cqQh2dkDcMKm/?ref=app

29th Jul 2021, 8:23 AM
Alex Voronin
Alex Voronin - avatar
4 Antworten
+ 2
Я имел ввиду что ты не использовал TABы правильно и почемуто твоя функция называется search() так же как и re.search(). Но все ровно там сверху я написал как использовать re.search() ....
29th Jul 2021, 8:49 AM
Aleksei Radchenkov
Aleksei Radchenkov - avatar
+ 1
Ок. Спасибо
29th Jul 2021, 8:53 AM
Alex Voronin
Alex Voronin - avatar
0
You had quite a few mistakes with how you implemented the function and the use of search() function. Here is how search() function is supposed to be used like: import re text = input() word = input() print(re.search(word, text)) s = re.search(word, text) if s: print("Word found") else: print("Word not found") Here is more info on search() function: https://www.tutorialspoint.com/the-search-function-in-JUMP_LINK__&&__python__&&__JUMP_LINK But i would also recommend going through python course again, cuz u definitely lack syntax.
29th Jul 2021, 8:36 AM
Aleksei Radchenkov
Aleksei Radchenkov - avatar
0
Послушай , я знаю что выводить текст нужно с помощью print(). Меня смутила формулировка “возвращать” «word found” а не «выводить». Я прошел только 39 уроков.. это не весь курс. Listen , I know that you need to print text using print. I was confused by the wording "return ""word found" and not "output". I have passed only 39 lessons of the initial stage.
29th Jul 2021, 8:44 AM
Alex Voronin
Alex Voronin - avatar