Day6:简单类与实例

`class BlogPost:
def init(self, title, content):
self.title = title
self.content = content

def show(self):
print(f"《{self.title}》\n{self.content}")

post = BlogPost("七天Python", "每天一个小例子")
post.show()`
知识点: class、init、实例方法

posted @ 2026-05-19 18:22  白底纸板  阅读(5)  评论(0)    收藏  举报