MCPcopy Create free account
hub / github.com/ActiveState/code / Stack

Class Stack

recipes/Python/475216_Bounded_Buffer_Example_1/recipe-475216.py:13–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11
12# for creating stacks
13class Stack:
14 def __init__(self):
15 self.__stack = list()
16 def __len__(self):
17 return len(self.__stack)
18 def push(self, item):
19 self.__stack.append(item)
20 def pop(self):
21 return self.__stack.pop()
22
23# provides an outline for the execution of the program
24def main():

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected