摘要: 面向对象的魔法方法 class C1: name = '张三丰' age = 18 def __init__(self, name): # 对象添加数据或改变数据时自动触发 print('__init__') def __str__(self): print('__str__') return f' 阅读全文
posted @ 2022-11-08 19:56 Python-moon 阅读(35) 评论(0) 推荐(0)