Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/dabeaz-course/practical-python
/ cost
Method
cost
Solutions/5_8/stock.py:27–31 ·
view source on GitHub ↗
Return the cost as shares*price
(self)
Source
from the content-addressed store, hash-verified
25
26
@property
27
def
cost(self):
28
''
&
#x27;
29
Return the cost
as
shares*price
30
''
&
#x27;
31
return
self.shares * self.price
32
33
def
sell(self, nshares):
34
''
&
#x27;
Callers
1
portfolio_cost
Function · 0.45
Calls
no outgoing calls
Tested by
no test coverage detected