project_python/2.2_lesson.20.20.py

23 lines
980 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

****Задание 20 Параграф 2.2***
***Вам предстоит проверить три строки, найти среди них ту, где встречается слово "зайка", и вывести её вместе с её длиной. Если таких строк несколько, выберите наименьшую в алфавитном порядке.
Для этого используйте составные условные операции, чтобы одновременно учесть несколько условий.***
if name == "main":
nature1 = input()
nature2 = input()
nature3 = input()
nature = ''
if 'зайка' in nature1:
nature = nature1
if 'зайка' in nature2:
if nature == '' or nature > nature2:
nature = nature2
if 'зайка' in nature3:
if nature == '' or nature > nature3:
nature = nature3
print(nature, len(nature))