dot operator in python

Solutions on MaxInterview for dot operator in python by the best coders in the world

showing results for - "dot operator in python"
Mia
05 Sep 2018
1# In python, almost everything is an object
2# An object is defined in a class
3# An object has methods (its own functions) and attributes (its own variables)
4# So a dot refers to a method (followed by () to call the method) or an attribute (no () because it is a variable, non-callable object)
5# For instance :
6Dog.age # refers to the age of the "Dog" object. This is an attribute
7Dog.bark() # is a method, it is an action defined in the Dog class
8# You can find more informations about this by searching about classes
similar questions
queries leading to this page
dot operator in python