assets = {"401k": 12000, "roth_ira": 6000, "savings": 8000, "car": 9000}
debts = {"car_loan": 6000, "credit_card": 1000}
worth = net_worth(assets, debts)
worth28000.0
Your estate is everything you own and everything you owe. Estate planning math asks two things about it: what is it worth, and how much of it do your beneficiary forms control? In this page I’ll answer both with net_worth() and beneficiary_share(), using the 25 year old from the Estate Planning chapter of the book so you can check each result.
Both functions take a dict of name to amount, as the book does. A plain list of amounts works too.
| Function | Returns | Units |
|---|---|---|
| net_worth() | total assets minus total debts | dollars (a float) |
| beneficiary_share() | the share of assets with a named beneficiary | a decimal (0.8875 is 88.75%) |
The chapter’s example is a 25 year old with a 401(k), a Roth IRA, some savings, and a car. On the other side are a car loan and a small credit card balance. The bar model puts what you own on one bar and what you owe on the other:

Net worth is the length of the top bar minus the length of the bottom bar. net_worth() adds up each dict and subtracts:
assets = {"401k": 12000, "roth_ira": 6000, "savings": 8000, "car": 9000}
debts = {"car_loan": 6000, "credit_card": 1000}
worth = net_worth(assets, debts)
worth28000.0
The estate is worth $28,000: $35,000 in assets minus $7,000 in debts.
Now add life insurance through work. Many employers give free coverage equal to one year of salary, say $45,000. It isn’t part of net worth while you’re alive, but it pays out when you die. The bar below shows everything that would pass to someone else, split by what decides who gets it:

The green sections are decided by forms you fill out online; only the vermillion section depends on a will. beneficiary_share() divides the green sections by the whole bar:
with_beneficiary = {
"401k": 12000,
"roth_ira": 6000,
"life_insurance": 45000,
"savings_pod": 8000,
}
without_beneficiary = {"car": 9000}
share = beneficiary_share(with_beneficiary, without_beneficiary)
share0.8875
About 89% of the estate is decided by forms that take minutes to fill out. That’s why the book puts beneficiary designations ahead of a will for most young people. Note that the result is a decimal, not a percent.
beneficiary_share() takes one estate at a time, so a list comprehension compares several. Here is the same estate with fewer forms filed:
scenarios = {
"all forms filed": (with_beneficiary, without_beneficiary),
"no POD on savings": (
{"401k": 12000, "roth_ira": 6000, "life_insurance": 45000},
{"savings": 8000, "car": 9000},
),
"retirement forms only": (
{"401k": 12000, "roth_ira": 6000},
{"life_insurance": 45000, "savings": 8000, "car": 9000},
),
}
pl.DataFrame({
"scenario": list(scenarios),
"share": [beneficiary_share(w, wo) for w, wo in scenarios.values()],
})| scenario | share |
|---|---|
| str | f64 |
| "all forms filed" | 0.8875 |
| "no POD on savings" | 0.7875 |
| "retirement forms only" | 0.225 |
Skipping the life insurance form costs the most, because it is the largest item. (Most employer life insurance asks for a beneficiary at enrollment; the last row shows what happens if you leave it blank.)
net_worth() adds the values you give it. It doesn’t know what a car is worth next year, so use today’s market value, and enter debts as positive balances. It ignores taxes owed on retirement accounts and the costs of probate.
beneficiary_share() returns a decimal, unlike the ratio functions that return percents. It ignores joint ownership, which also passes outside a will, and it stops with a ValueError when total assets aren’t greater than 0:
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) Cell In[5], line 1 ----> 1 beneficiary_share({}, {"car": 0}) File ~/work/perfinpy/perfinpy/src/perfinpy/estate_planning.py:97, in beneficiary_share(with_beneficiary, without_beneficiary) 95 total = named + _total(without_beneficiary, "without_beneficiary") 96 if total <= 0: ---> 97 raise ValueError("Total assets must be greater than 0.") 98 return named / total ValueError: Total assets must be greater than 0.
Both functions raise a TypeError for text and a ValueError for missing values.
Estates change as you save. Five years from now, suppose the retirement accounts grow at 7% a year (with future_value() from Investing Basics), savings reach $15,000, the car is paid off and worth $6,000, and the credit card is cleared:
retirement = future_value(present_value=[12000, 6000], rate=0.07, years=5)
assets_later = {
"401k": retirement[0],
"roth_ira": retirement[1],
"savings": 15000,
"car": 6000,
}
worth_later = net_worth(assets_later, debts={"car_loan": 0, "credit_card": 0})
share_later = beneficiary_share(
{
"401k": retirement[0],
"roth_ira": retirement[1],
"life_insurance": 45000,
"savings_pod": 15000,
},
{"car": 6000},
)
round(worth_later, 2), round(share_later, 4)(46245.93, 0.9342)
Net worth grows to $46,246, and the forms now decide 93% of the estate. The bigger the accounts get, the more those ten minute forms matter.
net_worth() gives the starting number for any estate plan: what you own minus what you owe. beneficiary_share() shows how much of that estate passes by beneficiary forms instead of a will. For most young people the answer is most of it, so fill in those forms first.
This is the last chapter of the book and the last page of the guide.