18 lines
764 B
Python
18 lines
764 B
Python
# 10 функций для учета заказов
|
||
def get_total(price, count): return price * count
|
||
def apply_tax(amount): return amount * 1.2
|
||
def get_discount(amount): return amount * 0.9 if amount > 1000 else amount
|
||
def format_item(item): return item.strip().capitalize()
|
||
def is_valid_count(count): return count > 0
|
||
def check_limit(amount): return amount < 100000
|
||
def get_status(is_paid): return "Оплачено" if is_paid else "Ожидает"
|
||
def calc_shipping(weight): return weight * 50
|
||
def get_info(id, item): return f"Заказ #{id}: {item}"
|
||
def final_report(res): print(f"Итог: {res} руб.")
|
||
|
||
if __name__ == "__main__":
|
||
# Пример вызова
|
||
price = get_total(100, 5)
|
||
with_tax = apply_tax(price)
|
||
final_report(with_tax)
|