Create roi_calculator.py
Browse files- roi_calculator.py +12 -0
roi_calculator.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
def calculate_roi(customer_usage, current_model, recommended_model):
|
| 2 |
+
annual_savings = (current_model.cost - recommended_model.cost) * customer_usage * 365
|
| 3 |
+
return {
|
| 4 |
+
'annual_savings': f'${annual_savings:,}',
|
| 5 |
+
'payback_period': 'Immediate',
|
| 6 |
+
'monthly_savings': f'${annual_savings/12:,}'
|
| 7 |
+
}
|
| 8 |
+
|
| 9 |
+
class Model:
|
| 10 |
+
def __init__(self, name, cost):
|
| 11 |
+
self.name = name
|
| 12 |
+
self.cost = cost
|