TypeError: 'builtin_function_or_method' object is not subscriptable

I think you want

listb.pop()[0]

The expression listb.pop is a valid python expression which results in a reference to the pop method, but doesn't actually call that method. You need to add the open and close parentheses to call the method.


Looks like you typed brackets instead of parenthesis by mistake.


instead of writing listb.pop[0] write

listb.pop()[0]
         ^
         |