stack.pop ()
stack = [[0,1], [4,2], [5,3], [8,4]]
print(stack.pop()[1])
#4
print(stack)
#[[0, 1], [4, 2], [5, 3]]
Wrong Wombat
stack = [[0,1], [4,2], [5,3], [8,4]]
print(stack.pop()[1])
#4
print(stack)
#[[0, 1], [4, 2], [5, 3]]
int pop() {
int data;
if(!isempty()) {
data = stack[top];
top = top - 1;
return data;
} else {
printf("Could not retrieve data, Stack is empty.\n");
}
}