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