We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 03d6e15 commit 5f49e24Copy full SHA for 5f49e24
stack.py
@@ -16,6 +16,12 @@ def length(self) -> int:
16
def __str__(self) -> str:
17
return str(self._data)
18
19
+ def __eq__(self, other: 'Stack') -> bool:
20
+ if self.__class__ == other.__class__:
21
+ if self._data == other._data and self._size == other._size:
22
+ return True
23
+ return False
24
+
25
def is_empty(self) -> bool:
26
return self._size == 0
27
0 commit comments