python3入門----變量

在python中變量類型是能夠動態變化的。python >>> a = 1 >>> a = 'a' >>> a 'a' int str tuple 值類型(不可變)   list set dict 引用類型(可變)code id()方法能夠看變量的idclass >>> a = 1 >>> id(a) 140733665432608 >>> a=2 >>> id(a) 14073366543264
相關文章
相關標籤/搜索