0
点赞
收藏
分享

微信扫一扫

Python面向对象之封装

Greatiga 2022-08-01 阅读 58

#__author__ = 'DouYunQian'

#coding=utf-8

'''

Python??????????

'''

class C1:

def __init__(self,name,obj):

self.name=name

self.obj=obj

class C2:

def __init__(self,name,age):

self.name=name

self.age=age

N1=C2("alex",18)

N2=C1("good",N1)

print(N2.obj.age)

举报

相关推荐

0 条评论