run_stack_ops(operations) where operations is a list of tuples like ("push", value) or ("pop",). Simulate a stack using a plain Python list (append = push, pop = pop from the end). Return the final list representing the stack's contents from bottom to top. Popping an empty stack should be a no-op (do not error).operations = [('push', 1), ('push', 2), ('pop',), ('push', 3)][1, 3]
Push 1, push 2, pop removes 2, push 3 leaves [1, 3].
.append() pushes onto the end (the "top").
.pop() removes from the end; guard against popping an empty list.