Language Syntax

Assignment — Python syntax

Bind the evaluated right-hand object to targets from left to right. Unpacking checks the number of items; assignment does not copy mutable objects.

Formal Syntax & Structure

python syntaxpython
target = expression

Parameters & Attributes

NameTypeDescription
targetassignment targetName, attribute, item or unpacking pattern to bind or update.
expressionexpressionEvaluated right-hand value.

Working Example

Example Snippetpython
a = b = []a.append(7)print((a is b, b))
Python Reference