Calculate · Assess & Decide · Analysis & Finance
Customer lifetime value (simple and discounted)
The customer lifetime in years, the simple LTV, and the discount-adjusted LTV you can put against CAC.
You receive: A reviewed LTV calculator + the passing test report, run on your per-year profit.
Part of Choose Business Model, Build a Sales Engine
Opens soon
This objective is verified and ready. It opens soon, once sign-in and payments are live.
Deliverable interface
The exact vocabulary the automated check enforces: keys, tokens, entry points, and worked examples. Generated from the verification source.
{
"constants": {},
"entryName": "compute_customer_lifetime_value",
"expectNote": "expect is the comparison-space value (your return value goes through normalize first when one is published)",
"hiddenCaseCount": 4,
"hiddenCaseNames": [
"with_discount",
"flat_profit_discounted",
"immediate_churn",
"no_churn_full_life"
],
"inputKeys": [
"discount_rate",
"yearly_profit"
],
"normalizeSource": "def _ltv_normalize(r):\n try:\n return {\"lifetime_years\": int(r[\"lifetime_years\"]), \"simple_ltv\": round(float(r[\"simple_ltv\"]), 2),\n \"discounted_ltv\": round(float(r[\"discounted_ltv\"]), 2)}\n except Exception:\n return repr(r)\n",
"returnShapes": [
[
"discounted_ltv",
"lifetime_years",
"simple_ltv"
]
],
"signature": "def compute_customer_lifetime_value(inp):",
"submission": "python exposing the entry function; inp is one input object; graded on held-out cases",
"tier": "calculator",
"visibleCases": [
{
"expect": {
"discounted_ltv": 5,
"lifetime_years": 3,
"simple_ltv": 5
},
"input": {
"discount_rate": 0,
"yearly_profit": [
1,
2,
2,
0
]
},
"name": "book_no_discount"
}
],
"vocabulary": [
"-?\\d+(?:\\.\\d+)?",
"discount_rate",
"discounted_ltv",
"lifetime_years",
"simple_ltv",
"yearly_profit"
]
}Example
A sample of what this objective produces. Your result is generated for your inputs.
Lifetime years
4.2
Simple ltv
3360
Discounted ltv
2789
Discount rate
0.1
Yearly profit
- 900
- 850
- 820
- 790
Note
Use the discounted LTV against CAC; the simple figure overstates by about 17 percent here.
Get early access to STUD the day it goes live.