12 函数返回值的地址引用
def fun(): s="python" print("%s address is %d" % (s,id(s))) return s f=fun() print("%s address is %d" % (f,id(f))) 运行结果: python address is 3049855780144 python address is 3049855780144 函数返回时,通过对地址的引用得到python ,即r 和s都是对py所在内存空间的引用
相关推荐
夜斗不是神 2020-11-17
huavhuahua 2020-11-20
Yasin 2020-11-16
xiaoseyihe 2020-11-16
千锋 2020-11-15
diyanpython 2020-11-12
chunjiekid 2020-11-10
wordmhg 2020-11-06
YENCSDN 2020-11-17
lsjweiyi 2020-11-17
houmenghu 2020-11-17
Erick 2020-11-17
HeyShHeyou 2020-11-17
以梦为马不负韶华 2020-10-20
lhtzbj 2020-11-17
pythonjw 2020-11-17
dingwun 2020-11-16
lhxxhl 2020-11-16