project_python/2.1_lesson.6.20.ру.py
2025-12-02 11:27:30 +05:00

11 lines
797 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.

****** Параграф 2,1 Задание 6 ******
*** Напишите программу, которая рассчитывает стоимость покупки и печатает чек в заданном формате. Итоговая стоимость вычисляется как произведение цены за килограмм и веса товара. Гарантируется, что у покупателя достаточно денег для покупки.***
item = input()
price = int(input())
weight = int(input())
money = int(input())
print('Чек', f'{item} - {weight}кг - {price}руб/кг', sep='\n')
print(f'Итого: {int(price * weight)}руб')
print(f'Внесено: {money}руб')
print(f'Сдача: {int(money - price * weight)}руб')