Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/dabeaz-course/practical-python
/ total_cost
Method
total_cost
Solutions/7_9/portfolio.py:20–21 ·
view source on GitHub ↗
(self)
Source
from the content-addressed store, hash-verified
18
19
@property
20
def
total_cost(self):
21
return
sum(s.shares * s.price
for
s in self._holdings)
22
23
def
tabulate_shares(self):
24
from
collections
import
Counter
Callers
nothing calls this directly
Calls
no outgoing calls
Tested by
no test coverage detected