1、程序运行中所有数据都是存储到内存中,然后才能运行
2、对象: 内存中存储数据的1块区域,称之为对象(比喻为容器)
a=123
b=456
ab 都是对象。
所有的变量都是对象: 字符串、数字,复数等。
print(type('123'))
print(type(123))
print(type(True))
print(type(6.732))
print(type(None))
print(type(1+2j))
输出
<class 'str'>
<class 'int'>
<class 'bool'>
<class 'float'>
<class 'NoneType'>
<class 'complex'>
3、对象结构
Id(类似人的身份证ID),Id不能更改,Id是分配的内存地址,不会改变。
type--类型,决定了对象有哪些功能,如人、自行车是不同的type,功能不同。
type也不能改变
value- 对象中存储的具体的值,值可以改变/不可变。(这个后续重点说明)
a=123, 123是不可变的。