/
sejeenn
/
python_basic
Обзор
Документация
Войти
/
sejeenn
/
python_basic
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Module19/10_palindrome_again/main.py
15 строк
463 B
Eugene Vorontsov
Copy repo python basic
03 фев 2025, 20:23
03 фев 2025, 20:23
a8fce4a
Код
Авторство
О чём код?
def is_poly(string): char_dict = {} for i_sym in string: char_dict[i_sym] = char_dict.get(i_sym, 0) + 1 odd_count = 0 for i_value in char_dict.values(): if i_value % 2 != 0: odd_count += 1 return odd_count <= 1 sym_str = input('Введите строку: ') if is_poly(sym_str): print('Можно сделать палиндромом.') else: print('Нельзя сделать палиндромом.')