From a2b25f361a04ea0e4ff6028c9e155b1fbac5bfe3 Mon Sep 17 00:00:00 2001 From: TheHakerTech Date: Sat, 1 Jun 2024 22:09:44 +0300 Subject: [PATCH] Added is_empty method --- ufpy/ustack.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ufpy/ustack.py b/ufpy/ustack.py index cf49e33..7b45b14 100644 --- a/ufpy/ustack.py +++ b/ufpy/ustack.py @@ -38,6 +38,9 @@ def append(self, *items) -> UStack: for item in items: self.__list.append(item) return self.__list + + def is_empty(self) -> bool: + return len(self) == 0 def __add__(self, stack: UStack) -> UStack: return UStack(self.__list + stack.__list)