uga/buga.py
2026-04-04 10:36:46 +03:00

19 lines
765 B
Python
Raw Permalink 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.

# 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)