python中并没有关键字const,在python中常常用大写的变量名作为常量。
1 a = 8 2 print(id(a)) 3 b = a 4 print(id(b))#此时b的地址和a的地址为同一地址 5 b = 10 6 print(id(b))#b的地址发生改变