Sure (note that the following applies specifically to Python but is also true of many other languages). Python, like many programming languages, supports Object Oriented Programming or OOP for short. In this paradigm (type of programming), we approach ideas as Objects much as we do in the real world. Each Object is an instance of a Class or a type of object. For example, I am Michael Rochlin. I am a person. I am also a Codecademy member and also a Codecademy Moderator. So we could say that there is an object, which we will call
michael_rochlin and it is an instance of a class
person can say his/her name so we might have a function or method that tells the person to say his/her name. That method would be called
say_name. It would be written inside the definition of the class
person so that every
person could use it.
Then we would create an instance of
person and name it
michael_rochlin. This instance is only one
person and we could have other instances like
linda(who are all Codecademy staff members BTW.)
So what does all this have to do with dot notation? Dot notation allows us to tell a instance of a class to use one of the methods inside that class. So if we called
michael_rochlin.say_name() it would call the method
say_name() that was written in the
person class because
michael_rochlin is a
"But Michael, we haven't learned anything about classes or OOP or objects or anything like that. What are you talking about!??"
In Python, almost everything you use is an object. You have used at least seven different classes of Objects. You have used Integers, Floats, Strings, Lists, Tuples, Dictionaries and Booleans. (don't worry if you haven't, you will) These are all special classes in Python and each has it's own methods.
One method of the
List class is
append() which appends a value to a list. What you are really doing is calling the method
append from the
List class on that object.
(There is a similar idea by modules, but its practically the same...)
Hope that helped, even if it was a little complicated. If you want more help, let me know