dot notation
Writing object.name to reach a method or attribute that belongs to an object or module, as in s.upper() or math.pi.
In more detail
The dot binds more tightly than any operator, so -x.count("a") negates the count. The same notation reaches into modules, classes and instances.
Related terms
- method — A function that belongs to an object or type and is called on a value of it, as in name.upper().
- attribute — A named value attached to an object and reached with a dot, such as point.x or math.pi; methods are attributes too.
- module — A file of code whose functions, classes and variables other files can use by importing it.
Taught in
- Objects, Methods And String Case — Hands-on Python: Complete Video Course & Book
- Classes And Instances — Hands-on Python: Complete Video Course & Book
- Methods, Attributes And self — Hands-on Python: Complete Video Course & Book