/
IvanKhabarov
/
python
Обзор
Документация
Войти
/
IvanKhabarov
/
python
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
Practice/pw14/task2.py
28 строк
568 B
Ivan-Khabarov
added task 15
21 окт 2024, 13:10
21 окт 2024, 13:10
0925304
Код
Авторство
О чём код?
from string import ascii_letters def check_str(text: str): """ >>> check_str('hello') 'hello' >>> check_str('Hello') 'hello' >>> check_str('Hello!!!') 'hello' >>> check_str('Привет world') ' world' >>> check_str('привет World!') ' world' """ alph = ascii_letters + ' ' result = '' for let in text: if let in alph: result += let return result.lower() if __name__ == '__main__': import doctest doctest.testmod(verbose=True) print(check_str('Привет hello'))