printffhelloworld / savaGitalk

存放gitalk
0 stars 0 forks source link

python变量间的相互引用与赋值 | Chen's blogs #6

Open printffhelloworld opened 4 years ago

printffhelloworld commented 4 years ago

https://printffhelloworld.github.io/2020/04/25/python%E5%8F%98%E9%87%8F%E9%97%B4%E7%9A%84%E7%9B%B8%E4%BA%92%E5%BC%95%E7%94%A8%E4%B8%8E%E8%B5%8B%E5%80%BC/

看一段代码: 12345#直接引用a= [1,2,3]b=aprint("变量a所在内存地址为:"+str(id(a))+"-值为:"+str(a))print("变量b所在内存地址为:"+str(id(b))+"-值为:"+str(b)) 运行一下。结果为: 12变量a所在内存地址为:3029425873544-值为:[1, 2, 3]变量b所在内存地址为:3029425873544-值为:

printffhelloworld commented 4 years ago

Anybody here?