Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/dabeaz-course/practical-python
/ sell
Method
sell
Solutions/8_1/stock.py:28–32 ·
view source on GitHub ↗
Sell a number of shares and return the remaining number.
(self, nshares)
Source
from the content-addressed store, hash-verified
26
return
self.shares * self.price
27
28
def
sell(self, nshares):
29
''
&
#x27;
30
Sell a number of shares and
return
the remaining number.
31
''
&
#x27;
32
self.shares -= nshares
Callers
1
test_sell
Method · 0.95
Calls
no outgoing calls
Tested by
1
test_sell
Method · 0.76