day 8

count 有两种方法:
可以在 def__init__:
Book.count +=1
或者在def__init__:里面加参数

def__init__ 是初始化时执行

def__del__(self):删除
Book.count -=1
repr 控制台
str 可以打印

年龄(随时间变化的解决方法)
datetime.date.today().year-self.birthday##生日信息

@property
@.setter

相关文章:

  • 2021-12-24
  • 2021-08-17
  • 2021-06-28
  • 2022-12-23
  • 2021-06-13
  • 2022-01-31
猜你喜欢
  • 2021-08-02
  • 2021-09-20
  • 2021-07-05
  • 2022-01-27
  • 2021-06-17
  • 2021-05-20
  • 2021-05-23
相关资源
相似解决方案