Binding Occurrence

suggest change
x = 5
x += 7
for x in iterable: pass

Each of the above statements is a binding occurrence. x = 5 binds x to 5. x += 7 binds x to the result of the addition. for x in iterable binds x to each element. If a binding statement appears inside a function, then x is function-local by default. See the “Syntax” section of Variable Scope and Binding for a list of binding statements.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents