From Learn Python the Hard Way:
Python sees you mentioned mystuff and looks up that variable. It might have to look backwards to see if you created with =, look and see if it is a function argument, or maybe it's a global variable. Either way it has to find the mystuff first.
Once it finds mystuff it then hits the . (period) operator and starts to look at variables that are a part of mystuff. Since mystuff is a list, it knows that mystuff has a bunch of functions.
It then hits append and compares the name "append" to all the ones that mystuff says it owns. If append is in there (it is) then it grabs that to use. Next Python sees the ( (parenthesis) and realizes, "Oh hey, this should be a function." At this point it calls (aka runs, executes) the function just like normally, but instead it calls the function with an extra argument.
That extra argument is ... mystuff! I know, weird right? But that's how Python works so it's best to just remember it and assume that's alright. What happens then, at the end of all this is a function call that looks like: append(mystuff, 'hello') instead of what you read which is mystuff.append('hello').
Where does he get "mystuff" from? And I'm still unsure about how that period operator thing works (sorry I'm new at this please bear with me), later on we get this:
ten_things = "Apples Oranges Crows Telephone Light Sugar"
print "Wait there's not 10 things in that list, let's fix that."
stuff = ten_things.split(' ')
I don't see how that string becomes a list after the last line, does the .split automatically turn it into one or what? What is the name of that period "split" or "append" thing he's doing? One of the main things screwing me up in programming is that I don't know what a lot of things are actually called. I know functions, variables, etc but some stuff like that .split just confuse me.
Help?
python. That way you can experiment with thingstype(variable)and it will tell you. Or if you want to know what are the names of things that you can type in after the.and what they do, you type inhelp(variable)and it will tell give you a list of all available methods(those are functions that are bound to that variable, which can be typed in after the.) with a description of what they do