Why do some methods use dot notation when others don’t?
Python is an object-oriented language, meaning it’s built around the idea of objects making things more scalable and reusable. You’ll be introduced to objects in depth later in the course, but for now think of objects as being built from blueprints that specify that object’s properties and methods.
Dot notation allows us to use methods belonging to an object. For example, if we had a Car object it might have an
ignition( ) method that we can use to turn the car on. Strings are objects just like a Car could be, and they have methods you can make use of, like
upper( ) and
Other methods that don’t use dot notation are not dependent on being attached to an object, and might even be built into the language, like the
len( ) method you learned about!