Next-Gen App & Browser Testing Cloud
Trusted by 2 Mn+ QAs & Devs to accelerate their release cycles

A period, or dot, in Python is the attribute-access operator. It tells Python that you want to reach the data or behavior that belongs to a specific object, module, or package. When you write something like text.upper(), the dot signals Python to look up the upper method on the string object named text and run it. The same operator also accesses module contents and, inside import statements, indicates relative package paths.
In Python everything is an object, and objects bundle together attributes (their data) and methods (their behavior). The dot is how you get to those members. Formally, an attribute reference is a primary followed by a period and a name; the object to the left of the dot is asked to produce the attribute whose name follows it.
name = "lambdatest"
# Method call: run upper() on the string object
print(name.upper()) # LAMBDATEST
# Attribute access on an object
class User:
def __init__(self, email):
self.email = email # 'email' is an attribute
u = User("[email protected]")
print(u.email) # [email protected]The dot also reaches names defined inside an imported module. After importing a module, type the module name, a dot, and the function, class, or constant you want to use.
import math
print(math.pi) # 3.141592653589793
print(math.sqrt(16)) # 4.0
# Dotted paths can go several levels deep
import os.path
print(os.path.join("dir", "file.txt"))Inside an import statement the dot has a different job: it describes a location relative to the current package. A single dot means the current package, two dots mean the parent package, and three dots mean the grandparent, and so on up the hierarchy.
# Import 'utils' from the current package
from . import utils
# Import a name from a sibling module in the current package
from .helpers import login
# Import from the parent package
from .. import configNot every period is the attribute operator. In a numeric literal such as 3.14, the period is a decimal point that creates a floating-point number. When several dots appear in one expression, they form a method chain, where each call acts on the object returned by the previous one, which is the recommended way to keep transformations readable.
# Decimal point: this dot builds a float
price = 3.14
print(type(price)) # <class 'float'>
# Method chaining: each dot works on the previous result
slug = " Hello World ".strip().lower().replace(" ", "-")
print(slug) # hello-worldThe period in Python is small but versatile. Most often it is the attribute-access operator that reaches an object's data and methods and the names inside modules. In import statements it signals relative package paths, and inside a numeric literal it is simply a decimal point. Knowing which role the dot is playing in a given line makes reading and debugging Python, especially test scripts, far easier.
A period, or dot, in Python is the attribute-access operator. It lets you reach the data (attributes) and behavior (methods) that belong to an object, module, or package. For example, text.upper() calls the upper method on the string object text.
Dot notation is used to access attributes and methods of objects, reach names inside imported modules (like math.pi), chain calls together, and, in import statements, indicate relative package paths such as from . import module.
In an import, a dot signals a relative import. A single dot means the current package, two dots mean the parent package, and three dots mean the grandparent. For example, from . import utils imports utils from the current package.
No. The period in a number like 3.14 is a decimal point that marks a floating-point literal. Dot notation, by contrast, is the operator that accesses attributes or methods, such as name.strip(). They look alike but serve entirely different roles.
Method chaining uses several dots in one expression to call methods in sequence on the returned object, such as text.strip().lower().replace(' ', '-'). Each dot acts on the result of the previous call, letting you transform data in a single readable line.
An AttributeError means the object to the left of the dot does not have the attribute or method you named. It is usually caused by a typo, calling a method on None, or using the wrong object type. Print the object and its type to debug.
KaneAI - Testing Assistant
World’s first AI-Native E2E testing agent.

TestMu AI forEnterprise
Get access to solutions built on Enterprise
grade security, privacy, & compliance