Answers for "python dot operator"

1

dot notation python

Almost everything in Python is an object. 
Every object has certain attributes and methods. 
The connection between the attributes or the methods with the object is 
indicated by a “dot” (”.”) written between them.
Posted by: Guest on August-29-2021
0

dot operator in python

# In python, almost everything is an object
# An object is defined in a class
# An object has methods (its own functions) and attributes (its own variables)
# 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)
# For instance :
Dog.age # refers to the age of the "Dog" object. This is an attribute
Dog.bark() # is a method, it is an action defined in the Dog class
# You can find more informations about this by searching about classes
Posted by: Guest on May-09-2021

Python Answers by Framework

Browse Popular Code Answers by Language