python 面向對象2

類屬性property 作用:1.property可以定義一個方法爲私有屬性的名字,讓用戶可以訪問年,但不能修改,可以保護數據的安全性 [email protected]屬性名.setter給私有屬性賦值時,先做判斷 [email protected]屬性名.deleter使用內置del刪除屬性的時候,自動執行的內容 class Student(object):         def __ini
相關文章
相關標籤/搜索