project_python/2.1_lesson.19.20.py
2025-12-09 14:32:44 +05:00

20 lines
829 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.

****** Задание 19 Параграф 2.1 ******
****** Напишите программу, которая выводит красиво оформленный чек. Все строки в чеке должны быть длиной ровно 35 символов, текст выровнен в соответствии с примером. ******
if name == "main":
name = input()
price = int(input())
weight = int(input())
money = int(input())
total = price * weight
change = money - total
print(f'{"Чек":=^35}')
print(f'Товар:{name:>29}')
print(f'Цена:{f"{weight}кг * {price}руб/кг":>30}')
print(f'Итого:{f"{total}руб":>29}')
print(f'Внесено:{f"{money}руб":>27}')
print(f'Сдача:{f"{change}руб":>29}')
print(f'=' * 35)