MCPcopy Create free account
hub / github.com/subbarayudu-j/TheAlgorithms-Python / pop

Method pop

data_structures/stacks/__init__.py:18–23  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

16 self.top += 1
17
18 def pop(self):
19 if self.is_empty():
20 return None
21 else:
22 self.top -= 1
23 return self.stack[self.top]

Callers

nothing calls this directly

Calls 1

is_emptyMethod · 0.95

Tested by

no test coverage detected