Ex. 38 Study Drill #2

It is written more_stuff.pop() and pop(more_stuff) are really the same thing.

I am unable to get it.
pop() is a list method and it has to be called on a list. So, I find the above statement very confusing. Assuming more_stuff is a list so how can we call it like this: pop(more_stuff)?

I will try to explain more on the above:

  1. more_stuff.pop() goes like this - Python will search for more_stuff first and as it finds it, it gets to know that it is of list data type. Further it realizes that list has a bunch of methods(or functions) and amongst all the methods it searches and finds pop() function. As no argument is given to the pop() function it executes the default argument on the list.

  2. pop(more_stuff) just doesn’t make sense to me. As it is not a general purpose function and it is a method specific to list.

PS: I strongly think I am mixing a lot of things here.

It has been very quiet here in the last few days. Hope the interaction begins soon :crossed_fingers: