TypeError: 'builtin_function_or_method' object is not subscriptable
You are trying to access pop as if was a list or a tupple, but pop is not. It's a method.
Looks like you typed brackets instead of parenthesis by mistake.
instead of writing listb.pop[0]
write
listb.pop()[0]
^
|
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.