What does it mean that pop will return a value to me?
pop() is a function, just like the ones you wrote in earlier exercises. The value it
returns is the element you remove from the array!
This is very useful when you want to do things like check a value being removed, which we couldn’t do with
del() since it doesn’t return a value. If we wanted to store a
popped value, we could do so like this:
my_list = ["cat", "dog", "mouse"] popped = my_list.pop(0) if popped == "cat": print "We found the cat!"