JustCaptain kod-buduschego
fb76709a56ac3b52d88ac79d26e74cc4267d61b2
Перейти к файлу
Код
task_1.py
import re

text: str = "У меня есть 3 яблока"


def search_numbers(text: str) -> list[str]:
    return re.findall(pattern=r"\d", string=text)


if len(search_numbers(text=text)) == 0:
    print("В строке есть число")
else:
    print("В строке нет числа")