python基础-类的封装
封装:类中封装了公有属性和方法,对象封装了私有属性的值
class F1: def __init__(self,n): self.N=n print('F') class F2: def __init__(self,arg1): self.a=arg1 print('F2') class F3: def __init__(self,arg2): self.b=arg1 print('F3') ol=F1("alex) o2=F2(o1) 03=F3(02) """"""""输出alex"""""""" o3.b==>02 02.a=01 03.b.a.N