From c3aa1f462d26b5e31385d7fd036c8b3b97f97aa6 Mon Sep 17 00:00:00 2001 From: user_2i Date: Tue, 2 Dec 2025 11:49:56 +0500 Subject: [PATCH] =?UTF-8?q?=D0=97=D0=B0=D0=B4=D0=B0=D0=BD=D0=B8=D0=B5=2019?= =?UTF-8?q?=20=D0=B8=D0=B7=2020=20=D0=BF=D0=B0=D1=80=D0=B0=D0=B3=D1=80?= =?UTF-8?q?=D0=B0=D1=84=202.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lesson_19.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 lesson_19.py diff --git a/lesson_19.py b/lesson_19.py new file mode 100644 index 0000000..c782c73 --- /dev/null +++ b/lesson_19.py @@ -0,0 +1,13 @@ +'''******* задание 19 из 20 параграф 2.1 ******** +* Напишите программу, которая выводит красиво оформленный чек. Все строки в чеке должны быть длиной ровно 35 символов, текст выровнен в соответствии с примером. +''' + +if __name__ == "__main__": + item, price, weight, money = input(), int(input()), int(input()), int(input()) + headings = ['Товар:', 'Цена:', 'Итого:', 'Внесено:', 'Сдача:'] + values = [item, f'{weight}кг * {price}руб/кг', f'{weight * price}руб', f'{money}руб', + f'{money - weight * price}руб'] + print('Чек'.center(35, '=')) + for i in range(len(headings)): + print(f"{headings[i] : <10}{values[i] : >25}") + print('=' * 35) \ No newline at end of file