/
eb
/
python_learn
Обзор
Документация
Войти
/
eb
/
python_learn
Код
Запросы
0
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
main
cycles/flush/flush.py
35 строк
792 B
EvgeniyBudaev
Initial commit
08 фев 2021, 20:58
08 фев 2021, 20:58
f6afe09
Код
Авторство
О чём код?
# Мой вариант table_cards = ["A_S", "J_H", "7_D", "8_D", "10_D"] handle_cards = ["J_D", "3_D"] table_suites = [x[-1] for x in table_cards] handle_suites = [i[-1] for i in handle_cards] suites_in_game = table_suites + handle_suites flush = False for suit in 'CHSD': if suites_in_game.count(suit) >= 5: flush = True if flush: print('Flush!') else: print('No Flush!') # Решение преподавателя table_cards = ["A_S", "J_H", "7_D", "8_D", "10_D"] handle_cards = ["J_D", "3_D"] table_suites = [x[-1] for x in table_cards] handle_suites = [i[-1] for i in handle_cards] suites_in_game = table_suites + handle_suites flush = any([suites_in_game.count(suit) >= 5 for suit in 'CHSD']) if flush: print('Flush!') else: print('No Flush!')