$ ./guess_the_languageProblem Solving — fill the blank
Problem Solving — fill the blank · easy · #101

What goes in the blank?

# removes and returns the last element of the list
stack = [1, 2, 3]
last = stack.____()
# last == 3, stack == [1, 2]

Answer: pop (also accepted: pop, pop())

pop() with no argument removes and returns the last list element.
Play Problem Solving ▸