project_python/2.2_lesson.16.20.py
2025-12-15 13:31:46 +05:00

40 lines
1.3 KiB
Python
Raw Permalink 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.

****Задание 16 Параграф 2.2***
***В новом сезоне за первенство в велогонках снова сражаются сильнейшие. Протяжённость финальной трассы — 43872м, и все хотят узнать, кто первым пересечёт финишную черту.
Нам известны средние скорости трёх претендентов — Пети, Васи и Толи. Кто станет победителем?***
if name == "main":
petya = int(input())
vasya = int(input())
tolya = int(input())
first = max(petya, vasya, tolya)
third = min(petya, vasya, tolya)
second = petya + vasya + tolya - first - third
if first == petya:
first_name = 'Петя'
elif first == vasya:
first_name = 'Вася'
else:
first_name = 'Толя'
if second == petya:
second_name = 'Петя'
elif second == vasya:
second_name = 'Вася'
else:
second_name = 'Толя'
if third == petya:
third_name = 'Петя'
elif third == vasya:
third_name = 'Вася'
else:
third_name = 'Толя'
print(f'{first_name: ^24}')
print(f'{second_name: ^8}{" ": ^16}')
print(f'{" ": ^16}{third_name: ^8}')
print(f'{"II": ^8}{"I": ^8}{"III": ^8}')