project_python/2.2_lesson.5.20.py
2025-12-09 14:53:54 +05:00

31 lines
729 B
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.

****Задание 5 Параграф 2.2***
****У Пети было 7 яблок, а у Васи 6.
Затем Петя отдал 3 яблока Васе, а у Толи взял 2 яблока.
Вася попросил у Толи 5 яблок, но отдал Гене 2.
Затем Дима дал Пете
N
N яблок, а Васе
M
M.
Так у кого в итоге яблок больше — у Пети или Васи?****
if name == "main":
petya = 7
vasya = 6
n_apples = int(input())
m_apples = int(input())
petya = petya - 3 + 2 + n_apples
vasya = vasya + 3 + 5 - 2 + m_apples
if petya > vasya:
print('Петя')
elif vasya > petya:
print('Вася')