Відповідь:
amount = float(input("Enter the purchase amount in UAH: "))
if amount > 1000:
discount_percent = 5
elif amount > 500:
discount_percent = 3
else:
discount_percent = 0
discount_amount = amount * discount_percent / 100
price_after_discount = amount - discount_amount
print("Purchase amount: {:.2f} UAH".format(amount))
print("Discount: {}%".format(discount_percent))
print("Discount amount: {:.2f} UAH".format(discount_amount))
print("Price after discount: {:.2f} UAH".format(price_after_discount))
Ответ:
p=int(input('сумма покупки: '))
s=1*(p<=500)+0.97*(500<p<=1000)+0.95*(p>1000)
print(f'стоимость покупки с учетом скидки {p*s}')
Объяснение:
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Відповідь:
amount = float(input("Enter the purchase amount in UAH: "))
if amount > 1000:
discount_percent = 5
elif amount > 500:
discount_percent = 3
else:
discount_percent = 0
discount_amount = amount * discount_percent / 100
price_after_discount = amount - discount_amount
print("Purchase amount: {:.2f} UAH".format(amount))
print("Discount: {}%".format(discount_percent))
print("Discount amount: {:.2f} UAH".format(discount_amount))
print("Price after discount: {:.2f} UAH".format(price_after_discount))
Ответ:
p=int(input('сумма покупки: '))
s=1*(p<=500)+0.97*(500<p<=1000)+0.95*(p>1000)
print(f'стоимость покупки с учетом скидки {p*s}')
Объяснение: