write a function in python pop(list) for performing pop operation in a stack of list containing integers
Answers
Answered by
3
l = [1, 2, 3, 4, 5]
def pop(arr):
if len(arr) > 0:
rem_item = arr[-1]
del arr[-1]
return rem_item
print(pop(l))
Similar questions
Social Sciences,
2 months ago
Math,
2 months ago
CBSE BOARD XII,
4 months ago
Math,
4 months ago
Math,
10 months ago