标签:glob ref oba ret tag 方便 终端 地址 tin
目录
x = 10
print(x) # 获取变量的变量值
print(id(x)) # 获取变量的id,可以理解成变量在内存中的地址
print(type(x)) # 获取变量的数据类型
name1=‘xiaoming‘
name2=‘xiaozhang‘
print(name1==name2) # False
x = 11
y = x
z = 11
print(x==y) # True
print(x is y) # True
print(x is z) # True,整数池的原因
x = 257
z = 257
print(x is z) # False
标签:glob ref oba ret tag 方便 终端 地址 tin
原文地址:https://www.cnblogs.com/gaohuayan/p/10895861.html