小编Ama*_*agi的帖子

Python,变量存储在内存中

a=[1234,1234] #list

a      
[1234, 1234] 

id(a[0])      
38032480

id(a[1])      
38032480

b=1234 #b is a variable of integer type

id(b)      
38032384
Run Code Online (Sandbox Code Playgroud)

为什么id(b)与python中的id(a [0])和id(a [1])不同?

python

5
推荐指数
1
解决办法
492
查看次数

标签 统计

python ×1