Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/dabeaz-course/python-mastery
/ cost
Method
cost
Solutions/3_1/stock.py:9–10 ·
view source on GitHub ↗
(self)
Source
from the content-addressed store, hash-verified
7
self.price = price
8
9
def
cost(self):
10
return
self.shares * self.price
11
12
def
sell(self, nshares):
13
self.shares -= nshares
Callers
nothing calls this directly
Calls
no outgoing calls
Tested by
no test coverage detected