Skip to content

Commit c2bbf3e

Browse files
remove function added
1 parent 42b27a9 commit c2bbf3e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

main.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,19 @@ def do_pop(self, value=-1):
9696
except Exception as e:
9797
do.log_error("Error is happend")
9898
do.log_exception("error is %s",e)
99+
100+
def do_remove(self,value):
101+
try:
102+
do.log("user want to delete %s value", value)
103+
if value in self.l:
104+
for i in range(len(self.l)):
105+
if self.l[i] == value:
106+
del self.l[i]
107+
break
108+
do.log("after remove list is: %s", self.l)
109+
else:
110+
raise Exception(f"{value} is not in list")
111+
112+
except Exception as e:
113+
do.log_error("Error is happend")
114+
do.log_exception("error is %s", str(e))

0 commit comments

Comments
 (0)