Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ActiveState/code
/ add
Method
add
recipes/Python/59884_RPN_Stack_class/recipe-59884.py:159–161 ·
view source on GitHub ↗
(self)
Source
from the content-addressed store, hash-verified
157
#do some math
158
159
def
add(self):
160
newx = self.gety() + self.getx()
161
self.pop(2); self.push(newx)
162
163
def
sub(self):
164
newx = self.gety() - self.getx()
Callers
nothing calls this directly
Calls
4
gety
Method · 0.95
getx
Method · 0.95
pop
Method · 0.45
push
Method · 0.45
Tested by
no test coverage detected