类的继承

"""
类的继承
"""
class A():
    name = "小黑"

class B(A):
    age = 18

b = B()
print(b.name)    #小黑

 

posted @ 2020-05-03 14:57  zh_小猿  阅读(88)  评论(0编辑  收藏  举报