Сделал 11 параграф 2.2
This commit is contained in:
parent
e70fc31f70
commit
402d7178dc
21
2.2_lesson.11.20.py
Normal file
21
2.2_lesson.11.20.py
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
****Задание 11 Параграф 2.2***
|
||||
***Напишите программу, которая проверяет, является ли число красивым.***
|
||||
|
||||
if name == "main":
|
||||
num = int(input())
|
||||
|
||||
first = num // 100
|
||||
second = num // 10 % 10
|
||||
third = num % 10
|
||||
|
||||
if max(first, second, third) != first and min(first, second, third) != first:
|
||||
middle = first
|
||||
elif max(first, second, third) != second and min(first, second, third) != second:
|
||||
middle = second
|
||||
else:
|
||||
middle = third
|
||||
|
||||
if max(first, second, third) + min(first, second, third) == middle * 2:
|
||||
print('YES')
|
||||
else:
|
||||
print('NO')
|
||||
Loading…
Reference in a new issue