This repository has been archived on 2025-05-11. You can view files and clone it, but cannot push or open issues or pull requests.
ute/utils.py

21 lines
473 B
Python

def get_average_price(plan: str) -> float:
"""
Get the average price for a plan
Args:
plan (str): Plan name. Can be "triple" or "doble"
Returns:
float: Average price
Raises:
Exception: If the plan is invalid
"""
if plan == "triple":
return (10.680 * 0.1667) + (2.223 * 0.2917) + (4.875 * 0.5416)
if plan == "doble":
return (10.680 * 0.1667) + (4.280 * 0.8333)
raise Exception("Invalid plan")