Variables and Expression
The object to which a reference is bound at a given time always has a type, but a given reference may be bound to objects of various types during the program's execution.
Variables
In Python there are no declarations.
The existence of a variable begins with a statement that binds the variable. You can also unbind a variable, resetting the name so it no longer holds a reference. The del statement unbinds references.
Rebinding or unbinding a reference has no effect on the object to which the reference was bound, except that an object disappears when nothing refers to it.
The automatic cleanup of objects bereft of references is known as garbage collection.
A global variable is an attribute of a module object. A local variable lives in a function's local namespace.
Object attributes and items
An attribute of an object is denoted by a reference to the object, followed by a period (.). Attributes that are callable are also known as methods.
An item of an object is denoted by a reference to the object, followed by an expression within brackets ([]).
Python draws no strong distinction between callable and noncallable objects, as some other languages do
Special expresion in Python
'expr,...' String conversion
x is y, x is not y Identity tests
x in y, x not in y Membership tests
not x Boolean NOT
x and y Boolean AND
x or y Boolean OR
lambda arg,...: expr Anonymous simple function