MCPcopy 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 '''
30 Sell a number of shares and return the remaining number.
31 '''
32 self.shares -= nshares

Callers 1

test_sellMethod · 0.95

Calls

no outgoing calls

Tested by 1

test_sellMethod · 0.76