1. Everything in Python is an object: every number, string, data structure, function, class, module are all referred to as a Python object.
2. Variables and argument passing
a=[1,2,3] # assigning a variable, we are creating a reference to the object on the right side of the equals sign
b=a # [1,2,3] has not been copies; now a and b refer to the same object
![](https://img.haomeiwen.com/i2118427/786fde64edd8721f.png)
3. Dynamic reference, strong type
Object reference in Python has no type associated with them.Variables are names for objects within a particular namespace; the type information is stored in the object itself. But Python is a strong type language.
![](https://img.haomeiwen.com/i2118427/d2fe3d90f05b4054.png)
4. Mutable and immutable objects
lists, dictionaries, NumPy arrays and self-defined are all mutable; tuple, string are immutable.
5. Scalar types
scalars/scalar types: numerical data, strings, boolean values, and dates and time.
![](https://img.haomeiwen.com/i2118427/ddb96733fb6b0983.png)
网友评论