Python初識面向對象

1、Python初識面向對象 1.1 封裝 class Person: country='中國' #靜態字段,能夠直接調用 def __init__(self,name,pwd): #Python類自帶的內置,會自動加載 self.name=name self.pwd=pwd def login(self):
相關文章
相關標籤/搜索